Commit f3b9d570 authored by jgruber's avatar jgruber Committed by Commit bot

[regexp] Let RegExp.prototype.compile return this

ES6 requires the compile method to return this:
www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.compile

BUG=v8:5722,chromium:585775

Review-Url: https://codereview.chromium.org/2577653002
Cr-Commit-Position: refs/heads/master@{#41705}
parent 77b50a8e
......@@ -852,12 +852,9 @@ TF_BUILTIN(RegExpPrototypeCompile, RegExpBuiltinsAssembler) {
Bind(&next);
}
RegExpInitialize(context, receiver, var_pattern.value(), var_flags.value());
// Return undefined for compatibility with JSC.
// See http://crbug.com/585775 for web compat details.
Return(UndefinedConstant());
Node* const result = RegExpInitialize(context, receiver, var_pattern.value(),
var_flags.value());
Return(result);
}
// ES6 21.2.5.10.
......
......@@ -3,4 +3,4 @@
// found in the LICENSE file.
var pattern = /foo/;
assertEquals(undefined, pattern.compile(pattern));
assertEquals(pattern, pattern.compile(pattern));
......@@ -360,12 +360,6 @@
'annexB/language/eval-code/direct/func-switch-case-eval-func-block-scoping': [FAIL],
'annexB/language/eval-code/direct/func-switch-dflt-eval-func-block-scoping': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=5137
'annexB/built-ins/RegExp/prototype/compile/flags-undefined': [FAIL],
'annexB/built-ins/RegExp/prototype/compile/pattern-regexp-distinct': [FAIL],
'annexB/built-ins/RegExp/prototype/compile/pattern-regexp-same': [FAIL],
'annexB/built-ins/RegExp/prototype/compile/pattern-undefined': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=5139
'annexB/built-ins/Date/prototype/setYear/time-clip': [FAIL],
'annexB/built-ins/Date/prototype/setYear/year-number-relative': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment