Commit cdec6d2b authored by adamk's avatar adamk Committed by Commit bot

Return undefined from RegExp.prototype.compile

This was changed to match Annex B.2.5.1 of ES2015 and Firefox in
https://chromium.googlesource.com/v8/v8/+/469d9bfa, but website
breakage was seen in M49 Beta. JSC still returns undefined here.

BUG=chromium:585775
LOG=y
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1714903004

Cr-Commit-Position: refs/heads/master@{#34172}
parent 9f42c693
...@@ -112,7 +112,10 @@ function RegExpCompileJS(pattern, flags) { ...@@ -112,7 +112,10 @@ function RegExpCompileJS(pattern, flags) {
pattern = REGEXP_SOURCE(pattern); pattern = REGEXP_SOURCE(pattern);
} }
return RegExpInitialize(this, pattern, flags); RegExpInitialize(this, pattern, flags);
// Return undefined for compatibility with JSC.
// See http://crbug.com/585775 for web compat details.
} }
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var pattern = /foo/;
assertEquals(undefined, pattern.compile(pattern));
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