Skip to content

Commit cdec6d2

Browse files
ajkleinCommit bot
authored andcommitted
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}
1 parent 9f42c69 commit cdec6d2

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/js/regexp.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ function RegExpCompileJS(pattern, flags) {
112112
pattern = REGEXP_SOURCE(pattern);
113113
}
114114

115-
return RegExpInitialize(this, pattern, flags);
115+
RegExpInitialize(this, pattern, flags);
116+
117+
// Return undefined for compatibility with JSC.
118+
// See http://crbug.com/585775 for web compat details.
116119
}
117120

118121

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright 2016 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
var pattern = /foo/;
6+
assertEquals(undefined, pattern.compile(pattern));

0 commit comments

Comments
 (0)