forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
String.prototype.matchAll should throw on non-global regex
https://bugs.webkit.org/show_bug.cgi?id=202838 Reviewed by Keith Miller. JSTests: * stress/string-matchall.js: Added. * test262/expectations.yaml: Mark four test cases as passing. Source/JavaScriptCore: * builtins/StringPrototype.js: (matchAll): Implement normative change from tc39/ecma262#1716. * builtins/BuiltinNames.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * runtime/RegExpConstructor.cpp: (JSC::esSpecIsRegExp): Added. * runtime/RegExpConstructor.h: Expose isRegExp to builtins. (This differs from @isRegExpObject by first checking for Symbol.match.) git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
43e0e14
commit 5ea437b
Showing
9 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
2019-10-23 Ross Kirsling <[email protected]> | ||
|
||
String.prototype.matchAll should throw on non-global regex | ||
https://bugs.webkit.org/show_bug.cgi?id=202838 | ||
|
||
Reviewed by Keith Miller. | ||
|
||
* stress/string-matchall.js: Added. | ||
|
||
* test262/expectations.yaml: | ||
Mark four test cases as passing. | ||
|
||
2019-10-23 Ross Kirsling <[email protected]> | ||
|
||
Update test262 (2019.10.11) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error(`expected ${expected} but got ${actual}`); | ||
} | ||
|
||
function shouldNotThrow(func) { | ||
func(); | ||
} | ||
|
||
function shouldThrowTypeError(func) { | ||
let error; | ||
try { | ||
func(); | ||
} catch (e) { | ||
error = e; | ||
} | ||
|
||
if (!(error instanceof TypeError)) | ||
throw new Error('Expected TypeError!'); | ||
} | ||
|
||
shouldThrowTypeError(() => { 'abaca'.matchAll(/a/); }); | ||
shouldThrowTypeError(() => { 'abaca'.matchAll(new RegExp('a')); }); | ||
shouldThrowTypeError(() => { 'abaca'.matchAll({ [Symbol.match]() {} }); }); | ||
|
||
shouldNotThrow(() => { 'abaca'.matchAll({ [Symbol.match]() {}, flags: 'g' }); }); | ||
|
||
shouldBe([...'abaca'.matchAll(/a/g)].join(), 'a,a,a'); | ||
shouldBe([...'abaca'.matchAll(new RegExp('a', 'g'))].join(), 'a,a,a'); | ||
shouldBe([...'abaca'.matchAll({ [Symbol.matchAll]: RegExp.prototype[Symbol.matchAll].bind(/a/g) })].join(), 'a,a,a'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
2019-10-23 Ross Kirsling <[email protected]> | ||
|
||
String.prototype.matchAll should throw on non-global regex | ||
https://bugs.webkit.org/show_bug.cgi?id=202838 | ||
|
||
Reviewed by Keith Miller. | ||
|
||
* builtins/StringPrototype.js: | ||
(matchAll): | ||
Implement normative change from https://github.com/tc39/ecma262/pull/1716. | ||
|
||
* builtins/BuiltinNames.h: | ||
* runtime/JSGlobalObject.cpp: | ||
(JSC::JSGlobalObject::init): | ||
* runtime/RegExpConstructor.cpp: | ||
(JSC::esSpecIsRegExp): Added. | ||
* runtime/RegExpConstructor.h: | ||
Expose isRegExp to builtins. (This differs from @isRegExpObject by first checking for Symbol.match.) | ||
|
||
2019-10-23 Sihui Liu <[email protected]> | ||
|
||
[ Mac WK1 ] REGRESSION (r251261): Layout Test inspector/console/webcore-logging.html is consistently Failing | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters