[ESNExt] String.prototype.matchAll
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jun 2019 21:21:48 +0000 (21:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jun 2019 21:21:48 +0000 (21:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186694

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-06-18
Reviewed by Yusuke Suzuki.

Implement String.prototype.matchAll.
(https://tc39.es/ecma262/#sec-string.prototype.matchall)

JSTests:

* test262/config.yaml:

Source/JavaScriptCore:

Also rename @globalPrivate @constructor functions and C++ variables holding them.

Shipping in Chrome since version 73.
Shipping in Firefox since version 67.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Scripts/wkbuiltins/builtins_generate_combined_header.py:
(get_var_name):
(generate_section_for_global_private_code_name_macro):
* Sources.txt:
* builtins/ArrayPrototype.js:
(globalPrivate.ArrayIterator):
(values):
(keys):
(entries):
(globalPrivate.createArrayIterator): Deleted.
* builtins/AsyncFromSyncIteratorPrototype.js:
(globalPrivate.createAsyncFromSyncIterator):
(globalPrivate.AsyncFromSyncIterator):
(globalPrivate.AsyncFromSyncIteratorConstructor): Deleted.
* builtins/BuiltinNames.h:
* builtins/MapPrototype.js:
(globalPrivate.MapIterator):
(values):
(keys):
(entries):
(globalPrivate.createMapIterator): Deleted.
* builtins/RegExpPrototype.js:
(globalPrivate.RegExpStringIterator):
(overriddenName.string_appeared_here.matchAll):
* builtins/RegExpStringIteratorPrototype.js: Added.
(next):
* builtins/SetPrototype.js:
(globalPrivate.SetIterator):
(values):
(entries):
(globalPrivate.createSetIterator): Deleted.
* builtins/StringPrototype.js:
(matchAll):
* builtins/TypedArrayPrototype.js:
(values):
(keys):
(entries):
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
* runtime/RegExpStringIteratorPrototype.cpp: Added.
(JSC::RegExpStringIteratorPrototype::finishCreation):
* runtime/RegExpStringIteratorPrototype.h: Added.
* runtime/StringPrototype.cpp:

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246567 268f45cc-cd09-0410-ab3c-d52691b4dbfc

27 files changed:
JSTests/ChangeLog
JSTests/test262/config.yaml
LayoutTests/ChangeLog
LayoutTests/js/Object-getOwnPropertyNames-expected.txt
LayoutTests/js/script-tests/Object-getOwnPropertyNames.js
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/DerivedSources-input.xcfilelist
Source/JavaScriptCore/DerivedSources.make
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_combined_header.py
Source/JavaScriptCore/Sources.txt
Source/JavaScriptCore/builtins/ArrayPrototype.js
Source/JavaScriptCore/builtins/AsyncFromSyncIteratorPrototype.js
Source/JavaScriptCore/builtins/BuiltinNames.h
Source/JavaScriptCore/builtins/MapPrototype.js
Source/JavaScriptCore/builtins/RegExpPrototype.js
Source/JavaScriptCore/builtins/RegExpStringIteratorPrototype.js [new file with mode: 0644]
Source/JavaScriptCore/builtins/SetPrototype.js
Source/JavaScriptCore/builtins/StringPrototype.js
Source/JavaScriptCore/builtins/TypedArrayPrototype.js
Source/JavaScriptCore/runtime/CommonIdentifiers.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/RegExpPrototype.cpp
Source/JavaScriptCore/runtime/RegExpStringIteratorPrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/RegExpStringIteratorPrototype.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/StringPrototype.cpp

index 0a6f613..789d22f 100644 (file)
@@ -1,3 +1,15 @@
+2019-06-18  Alexey Shvayka  <shvaikalesh@gmail.com>
+
+        [ESNExt] String.prototype.matchAll
+        https://bugs.webkit.org/show_bug.cgi?id=186694
+
+        Reviewed by Yusuke Suzuki.
+
+        Implement String.prototype.matchAll.
+        (https://tc39.es/ecma262/#sec-string.prototype.matchall)
+
+        * test262/config.yaml:
+
 2019-06-18  Tadeu Zagallo  <tzagallo@apple.com>
 
         DFG code should not reify the names of builtin functions with private names
index df1bbc7..b44f432 100644 (file)
@@ -12,9 +12,6 @@ skip:
     - BigInt
     # https://bugs.webkit.org/show_bug.cgi?id=166693
     - async-iteration
-    # https://bugs.webkit.org/show_bug.cgi?id=186694
-    - String.prototype.matchAll
-    - Symbol.matchAll
     # https://bugs.webkit.org/show_bug.cgi?id=174931
     - regexp-lookbehind
 
index bb91543..ca9606d 100644 (file)
@@ -1,3 +1,16 @@
+2019-06-18  Alexey Shvayka  <shvaikalesh@gmail.com>
+
+        [ESNExt] String.prototype.matchAll
+        https://bugs.webkit.org/show_bug.cgi?id=186694
+
+        Reviewed by Yusuke Suzuki.
+
+        Implement String.prototype.matchAll.
+        (https://tc39.es/ecma262/#sec-string.prototype.matchall)
+
+        * js/Object-getOwnPropertyNames-expected.txt:
+        * js/script-tests/Object-getOwnPropertyNames.js:
+
 2019-06-18  Keith Miller  <keith_miller@apple.com>
 
         Add support for WeakRef
index 565258e..91c2620 100644 (file)
@@ -49,7 +49,7 @@ PASS getSortedOwnPropertyNames(Function.prototype) is ['apply', 'arguments', 'bi
 PASS getSortedOwnPropertyNames(Array) is ['from', 'isArray', 'length', 'name', 'of', 'prototype']
 PASS getSortedOwnPropertyNames(Array.prototype) is ['concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'flat', 'flatMap', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']
 PASS getSortedOwnPropertyNames(String) is ['fromCharCode', 'fromCodePoint', 'length', 'name', 'prototype', 'raw']
-PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'codePointAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'normalize', 'padEnd', 'padStart', 'repeat', 'replace', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimEnd', 'trimLeft', 'trimRight', 'trimStart', 'valueOf']
+PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'codePointAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'matchAll', 'normalize', 'padEnd', 'padStart', 'repeat', 'replace', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimEnd', 'trimLeft', 'trimRight', 'trimStart', 'valueOf']
 PASS getSortedOwnPropertyNames(Boolean) is ['length', 'name', 'prototype']
 PASS getSortedOwnPropertyNames(Boolean.prototype) is ['constructor', 'toString', 'valueOf']
 PASS getSortedOwnPropertyNames(Number) is ['EPSILON', 'MAX_SAFE_INTEGER', 'MAX_VALUE', 'MIN_SAFE_INTEGER', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'isFinite', 'isInteger', 'isNaN', 'isSafeInteger', 'length', 'name', 'parseFloat', 'parseInt', 'prototype']
@@ -62,7 +62,7 @@ PASS getSortedOwnPropertyNames(Error) is ['length', 'name', 'prototype', 'stackT
 PASS getSortedOwnPropertyNames(Error.prototype) is ['constructor', 'message', 'name', 'toString']
 PASS getSortedOwnPropertyNames(Math) is ['E','LN10','LN2','LOG10E','LOG2E','PI','SQRT1_2','SQRT2','abs','acos','acosh','asin','asinh','atan','atan2','atanh','cbrt','ceil','clz32','cos','cosh','exp','expm1','floor','fround','hypot','imul','log','log10','log1p','log2','max','min','pow','random','round','sign','sin','sinh','sqrt','tan','tanh','trunc']
 PASS getSortedOwnPropertyNames(JSON) is ['parse', 'stringify']
-PASS getSortedOwnPropertyNames(Symbol) is ['asyncIterator','for', 'hasInstance', 'isConcatSpreadable', 'iterator', 'keyFor', 'length', 'match', 'name', 'prototype', 'replace', 'search', 'species', 'split', 'toPrimitive', 'toStringTag', 'unscopables']
+PASS getSortedOwnPropertyNames(Symbol) is ['asyncIterator','for', 'hasInstance', 'isConcatSpreadable', 'iterator', 'keyFor', 'length', 'match', 'matchAll', 'name', 'prototype', 'replace', 'search', 'species', 'split', 'toPrimitive', 'toStringTag', 'unscopables']
 PASS getSortedOwnPropertyNames(Symbol.prototype) is ['constructor', 'description', 'toString', 'valueOf']
 PASS getSortedOwnPropertyNames(Map) is ['length', 'name', 'prototype']
 PASS getSortedOwnPropertyNames(Map.prototype) is ['clear', 'constructor', 'delete', 'entries', 'forEach', 'get', 'has', 'keys', 'set', 'size', 'values']
index 32a38c3..43b1c63 100644 (file)
@@ -58,7 +58,7 @@ var expectedPropertyNamesSet = {
     "Array": "['from', 'isArray', 'length', 'name', 'of', 'prototype']",
     "Array.prototype": "['concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'flat', 'flatMap', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']",
     "String": "['fromCharCode', 'fromCodePoint', 'length', 'name', 'prototype', 'raw']",
-    "String.prototype": "['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'codePointAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'normalize', 'padEnd', 'padStart', 'repeat', 'replace', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimEnd', 'trimLeft', 'trimRight', 'trimStart', 'valueOf']",
+    "String.prototype": "['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'codePointAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'matchAll', 'normalize', 'padEnd', 'padStart', 'repeat', 'replace', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimEnd', 'trimLeft', 'trimRight', 'trimStart', 'valueOf']",
     "Boolean": "['length', 'name', 'prototype']",
     "Boolean.prototype": "['constructor', 'toString', 'valueOf']",
     "Number": "['EPSILON', 'MAX_SAFE_INTEGER', 'MAX_VALUE', 'MIN_SAFE_INTEGER', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'isFinite', 'isInteger', 'isNaN', 'isSafeInteger', 'length', 'name', 'parseFloat', 'parseInt', 'prototype']",
@@ -71,7 +71,7 @@ var expectedPropertyNamesSet = {
     "Error.prototype": "['constructor', 'message', 'name', 'toString']",
     "Math": "['E','LN10','LN2','LOG10E','LOG2E','PI','SQRT1_2','SQRT2','abs','acos','acosh','asin','asinh','atan','atan2','atanh','cbrt','ceil','clz32','cos','cosh','exp','expm1','floor','fround','hypot','imul','log','log10','log1p','log2','max','min','pow','random','round','sign','sin','sinh','sqrt','tan','tanh','trunc']",
     "JSON": "['parse', 'stringify']",
-    "Symbol": "['asyncIterator','for', 'hasInstance', 'isConcatSpreadable', 'iterator', 'keyFor', 'length', 'match', 'name', 'prototype', 'replace', 'search', 'species', 'split', 'toPrimitive', 'toStringTag', 'unscopables']",
+    "Symbol": "['asyncIterator','for', 'hasInstance', 'isConcatSpreadable', 'iterator', 'keyFor', 'length', 'match', 'matchAll', 'name', 'prototype', 'replace', 'search', 'species', 'split', 'toPrimitive', 'toStringTag', 'unscopables']",
     "Symbol.prototype": "['constructor', 'description', 'toString', 'valueOf']",
     "Map": "['length', 'name', 'prototype']",
     "Map.prototype": "['clear', 'constructor', 'delete', 'entries', 'forEach', 'get', 'has', 'keys', 'set', 'size', 'values']",
index d8f3640..d98353d 100644 (file)
@@ -88,6 +88,7 @@ set(JavaScriptCore_OBJECT_LUT_SOURCES
     runtime/ReflectObject.cpp
     runtime/RegExpConstructor.cpp
     runtime/RegExpPrototype.cpp
+    runtime/RegExpStringIteratorPrototype.cpp
     runtime/SetPrototype.cpp
     runtime/StringConstructor.cpp
     runtime/StringPrototype.cpp
@@ -931,6 +932,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
     runtime/RegExpGlobalData.h
     runtime/RegExpKey.h
     runtime/RegExpObject.h
+    runtime/RegExpStringIteratorPrototype.h
     runtime/RuntimeFlags.h
     runtime/RuntimeType.h
     runtime/SamplingProfiler.h
@@ -1204,6 +1206,7 @@ set(JavaScriptCore_BUILTINS_SOURCES
     ${JAVASCRIPTCORE_DIR}/builtins/PromisePrototype.js
     ${JAVASCRIPTCORE_DIR}/builtins/ReflectObject.js
     ${JAVASCRIPTCORE_DIR}/builtins/RegExpPrototype.js
+    ${JAVASCRIPTCORE_DIR}/builtins/RegExpStringIteratorPrototype.js
     ${JAVASCRIPTCORE_DIR}/builtins/SetIteratorPrototype.js
     ${JAVASCRIPTCORE_DIR}/builtins/SetPrototype.js
     ${JAVASCRIPTCORE_DIR}/builtins/StringConstructor.js
index 27ee95e..e2016f3 100644 (file)
@@ -1,3 +1,69 @@
+2019-06-18  Alexey Shvayka  <shvaikalesh@gmail.com>
+
+        [ESNExt] String.prototype.matchAll
+        https://bugs.webkit.org/show_bug.cgi?id=186694
+
+        Reviewed by Yusuke Suzuki.
+
+        Implement String.prototype.matchAll.
+        (https://tc39.es/ecma262/#sec-string.prototype.matchall)
+
+        Also rename @globalPrivate @constructor functions and C++ variables holding them.
+
+        Shipping in Chrome since version 73.
+        Shipping in Firefox since version 67.
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources.make:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * Scripts/wkbuiltins/builtins_generate_combined_header.py:
+        (get_var_name):
+        (generate_section_for_global_private_code_name_macro):
+        * Sources.txt:
+        * builtins/ArrayPrototype.js:
+        (globalPrivate.ArrayIterator):
+        (values):
+        (keys):
+        (entries):
+        (globalPrivate.createArrayIterator): Deleted.
+        * builtins/AsyncFromSyncIteratorPrototype.js:
+        (globalPrivate.createAsyncFromSyncIterator):
+        (globalPrivate.AsyncFromSyncIterator):
+        (globalPrivate.AsyncFromSyncIteratorConstructor): Deleted.
+        * builtins/BuiltinNames.h:
+        * builtins/MapPrototype.js:
+        (globalPrivate.MapIterator):
+        (values):
+        (keys):
+        (entries):
+        (globalPrivate.createMapIterator): Deleted.
+        * builtins/RegExpPrototype.js:
+        (globalPrivate.RegExpStringIterator):
+        (overriddenName.string_appeared_here.matchAll):
+        * builtins/RegExpStringIteratorPrototype.js: Added.
+        (next):
+        * builtins/SetPrototype.js:
+        (globalPrivate.SetIterator):
+        (values):
+        (entries):
+        (globalPrivate.createSetIterator): Deleted.
+        * builtins/StringPrototype.js:
+        (matchAll):
+        * builtins/TypedArrayPrototype.js:
+        (values):
+        (keys):
+        (entries):
+        * runtime/CommonIdentifiers.h:
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init):
+        * runtime/RegExpPrototype.cpp:
+        (JSC::RegExpPrototype::finishCreation):
+        * runtime/RegExpStringIteratorPrototype.cpp: Added.
+        (JSC::RegExpStringIteratorPrototype::finishCreation):
+        * runtime/RegExpStringIteratorPrototype.h: Added.
+        * runtime/StringPrototype.cpp:
+
 2019-06-18  Keith Miller  <keith_miller@apple.com>
 
         Add support for WeakRef
index 1920035..5fc30d0 100644 (file)
@@ -49,6 +49,7 @@ $(PROJECT_DIR)/builtins/PromiseOperations.js
 $(PROJECT_DIR)/builtins/PromisePrototype.js
 $(PROJECT_DIR)/builtins/ReflectObject.js
 $(PROJECT_DIR)/builtins/RegExpPrototype.js
+$(PROJECT_DIR)/builtins/RegExpStringIteratorPrototype.js
 $(PROJECT_DIR)/builtins/SetIteratorPrototype.js
 $(PROJECT_DIR)/builtins/SetPrototype.js
 $(PROJECT_DIR)/builtins/StringConstructor.js
index 3c147ee..8ed0ac7 100644 (file)
@@ -111,6 +111,7 @@ JavaScriptCore_BUILTINS_SOURCES = \
     $(JavaScriptCore)/builtins/PromisePrototype.js \
     $(JavaScriptCore)/builtins/ReflectObject.js \
     $(JavaScriptCore)/builtins/RegExpPrototype.js \
+    ${JavaScriptCore}/builtins/RegExpStringIteratorPrototype.js \
     $(JavaScriptCore)/builtins/SetIteratorPrototype.js \
     $(JavaScriptCore)/builtins/SetPrototype.js \
     $(JavaScriptCore)/builtins/StringConstructor.js \
index b405a2a..7e435b6 100644 (file)
                7D734FE420B4D8410018844A /* IntlCanonicalizeLanguage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IntlCanonicalizeLanguage.h; sourceTree = "<group>"; };
                7E4EE7080EBB7963005934AA /* StructureChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureChain.h; sourceTree = "<group>"; };
                7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructureChain.cpp; sourceTree = "<group>"; };
+               84925A9A22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpStringIteratorPrototype.cpp; sourceTree = "<group>"; };
+               84925A9B22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpStringIteratorPrototype.h; sourceTree = "<group>"; };
+               84925A9C22B30CC800D1DFFF /* RegExpStringIteratorPrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = RegExpStringIteratorPrototype.js; sourceTree = "<group>"; };
                860161DF0F3A83C100F84710 /* AbstractMacroAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractMacroAssembler.h; sourceTree = "<group>"; };
                860161E00F3A83C100F84710 /* MacroAssemblerX86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86.h; sourceTree = "<group>"; };
                860161E10F3A83C100F84710 /* MacroAssemblerX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86_64.h; sourceTree = "<group>"; };
                                0F7C39FC1C8F659500480151 /* RegExpObjectInlines.h */,
                                BCD202BF0E1706A7002C7E82 /* RegExpPrototype.cpp */,
                                BCD202C00E1706A7002C7E82 /* RegExpPrototype.h */,
+                               84925A9A22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.cpp */,
+                               84925A9B22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.h */,
                                70B0A9D01A9B66200001306A /* RuntimeFlags.h */,
                                527773DD1AAF83AC00BDE7E8 /* RuntimeType.cpp */,
                                52C0611D1AA51E1B00B4ADBA /* RuntimeType.h */,
                                7CFBAC1C18B535E500D00750 /* PromisePrototype.js */,
                                7CF9BC5F1B65D9B1009DB1EF /* ReflectObject.js */,
                                654788421C937D2C000781A0 /* RegExpPrototype.js */,
+                               84925A9C22B30CC800D1DFFF /* RegExpStringIteratorPrototype.js */,
                                7035587D1C418419004BD7BF /* SetPrototype.js */,
                                7CF9BC601B65D9B1009DB1EF /* StringConstructor.js */,
                                7CF9BC611B65D9B1009DB1EF /* StringIteratorPrototype.js */,
index f092805..85dbe72 100644 (file)
@@ -33,8 +33,14 @@ from string import Template
 from builtins_generator import BuiltinsGenerator
 from builtins_templates import BuiltinsGeneratorTemplates as Templates
 
-log = logging.getLogger('global')
 
+def get_var_name(function):
+    var_name = function.function_name
+    if function.is_constructor:
+        return var_name[:1].lower() + var_name[1:] + 'Constructor'
+    return var_name
+
+log = logging.getLogger('global')
 
 class BuiltinsCombinedHeaderGenerator(BuiltinsGenerator):
     def __init__(self, model):
@@ -164,10 +170,11 @@ extern const JSC::ConstructAbility s_%(codeName)sConstructAbility;""" % function
         functions.sort(key=lambda x: x.function_name)
         for function in functions:
             function_args = {
+                'varName': get_var_name(function),
                 'funcName': function.function_name,
                 'codeName': BuiltinsGenerator.mangledNameForFunction(function),
             }
 
-            lines.append("    macro(%(funcName)s, %(codeName)s) \\" % function_args)
+            lines.append("    macro(%(varName)s, %(funcName)s, %(codeName)s) \\" % function_args)
 
         return '\n'.join(lines)
index ecc21a2..e41b755 100644 (file)
@@ -922,6 +922,7 @@ runtime/RegExpGlobalData.cpp
 runtime/RegExpMatchesArray.cpp
 runtime/RegExpObject.cpp
 runtime/RegExpPrototype.cpp
+runtime/RegExpStringIteratorPrototype.cpp
 runtime/RuntimeType.cpp
 runtime/SamplingCounter.cpp
 runtime/SamplingProfiler.cpp
index 1b518f6..09eec65 100644 (file)
@@ -26,7 +26,7 @@
 
 @constructor
 @globalPrivate
-function createArrayIterator(iteratedObject, kind, iterationFunction)
+function ArrayIterator(iteratedObject, kind, iterationFunction)
 {
     "use strict";
 
@@ -41,21 +41,21 @@ function values()
 {
     "use strict";
 
-    return new @createArrayIterator(@toObject(this, "Array.prototype.values requires that |this| not be null or undefined"), "value", @arrayIteratorValueNext);
+    return new @ArrayIterator(@toObject(this, "Array.prototype.values requires that |this| not be null or undefined"), "value", @arrayIteratorValueNext);
 }
 
 function keys()
 {
     "use strict";
 
-    return new @createArrayIterator(@toObject(this, "Array.prototype.keys requires that |this| not be null or undefined"), "key", @arrayIteratorKeyNext);
+    return new @ArrayIterator(@toObject(this, "Array.prototype.keys requires that |this| not be null or undefined"), "key", @arrayIteratorKeyNext);
 }
 
 function entries()
 {
     "use strict";
 
-    return new @createArrayIterator(@toObject(this, "Array.prototype.entries requires that |this| not be null or undefined"), "key+value", @arrayIteratorKeyValueNext);
+    return new @ArrayIterator(@toObject(this, "Array.prototype.entries requires that |this| not be null or undefined"), "key+value", @arrayIteratorKeyValueNext);
 }
 
 function reduce(callback /*, initialValue */)
index 6ea1a7f..1950d7e 100644 (file)
@@ -156,12 +156,12 @@ function createAsyncFromSyncIterator(syncIterator, nextMethod)
     if (!@isObject(syncIterator))
         @throwTypeError('Only objects can be wrapped by async-from-sync wrapper');
 
-    return new @AsyncFromSyncIteratorConstructor(syncIterator, nextMethod);
+    return new @AsyncFromSyncIterator(syncIterator, nextMethod);
 }
 
 @globalPrivate
 @constructor
-function AsyncFromSyncIteratorConstructor(syncIterator, nextMethod)
+function AsyncFromSyncIterator(syncIterator, nextMethod)
 {
     "use strict";
 
index dd0d673..edf00e6 100644 (file)
@@ -164,6 +164,11 @@ namespace JSC {
     macro(regExpSearchFast) \
     macro(regExpSplitFast) \
     macro(regExpTestFast) \
+    macro(regExpStringIteratorRegExp) \
+    macro(regExpStringIteratorString) \
+    macro(regExpStringIteratorGlobal) \
+    macro(regExpStringIteratorUnicode) \
+    macro(regExpStringIteratorDone) \
     macro(stringIncludesInternal) \
     macro(stringSplitFast) \
     macro(stringSubstrInternal) \
index c35c5a8..8464459 100644 (file)
@@ -25,7 +25,7 @@
 
 @constructor
 @globalPrivate
-function createMapIterator(iteratedObject, kind)
+function MapIterator(iteratedObject, kind)
 {
     "use strict";
 
@@ -42,7 +42,7 @@ function values()
     if (!@isMap(this))
         @throwTypeError("Map.prototype.values requires that |this| be Map");
 
-    return new @createMapIterator(this, @iterationKindValue);
+    return new @MapIterator(this, @iterationKindValue);
 }
 
 function keys()
@@ -52,7 +52,7 @@ function keys()
     if (!@isMap(this))
         @throwTypeError("Map.prototype.keys requires that |this| be Map");
 
-    return new @createMapIterator(this, @iterationKindKey);
+    return new @MapIterator(this, @iterationKindKey);
 }
 
 function entries()
@@ -62,7 +62,7 @@ function entries()
     if (!@isMap(this))
         @throwTypeError("Map.prototype.entries requires that |this| be Map");
 
-    return new @createMapIterator(this, @iterationKindKeyValue);
+    return new @MapIterator(this, @iterationKindKeyValue);
 }
 
 function forEach(callback /*, thisArg */)
index 4854c56..46ae57d 100644 (file)
  */
 
 @globalPrivate
+@constructor
+function RegExpStringIterator(regExp, string, global, fullUnicode)
+{
+    "use strict";
+
+    @putByIdDirectPrivate(this, "regExpStringIteratorRegExp", regExp);
+    @putByIdDirectPrivate(this, "regExpStringIteratorString", string);
+    @putByIdDirectPrivate(this, "regExpStringIteratorGlobal", global);
+    @putByIdDirectPrivate(this, "regExpStringIteratorUnicode", fullUnicode);
+    @putByIdDirectPrivate(this, "regExpStringIteratorDone", false);
+}
+
+@globalPrivate
 function advanceStringIndex(string, index, unicode)
 {
     // This function implements AdvanceStringIndex described in ES6 21.2.5.2.3.
@@ -142,6 +155,28 @@ function match(strArg)
     return @matchSlow(this, str);
 }
 
+@overriddenName="[Symbol.matchAll]"
+function matchAll(strArg)
+{
+    "use strict";
+
+    let regExp = this;
+    if (!@isObject(regExp))
+        @throwTypeError("RegExp.prototype.@@matchAll requires |this| to be an Object");
+
+    let string = @toString(strArg);
+    let Matcher = @speciesConstructor(regExp, @RegExp);
+
+    let flags = @toString(regExp.flags);
+    let matcher = new Matcher(regExp, flags);
+    matcher.lastIndex = @toLength(regExp.lastIndex);
+
+    let global = @stringIncludesInternal.@call(flags, "g");
+    let fullUnicode = @stringIncludesInternal.@call(flags, "u");
+
+    return new @RegExpStringIterator(matcher, string, global, fullUnicode);
+}
+
 @overriddenName="[Symbol.replace]"
 function replace(strArg, replace)
 {
diff --git a/Source/JavaScriptCore/builtins/RegExpStringIteratorPrototype.js b/Source/JavaScriptCore/builtins/RegExpStringIteratorPrototype.js
new file mode 100644 (file)
index 0000000..a03ba6b
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2019 Alexey Shvayka <shvaikalesh@gmail.com>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+function next()
+{
+    "use strict";
+
+    if (!@isObject(this))
+        @throwTypeError("%RegExpStringIteratorPrototype%.next requires |this| to be an Object");
+
+    let done = @getByIdDirectPrivate(this, "regExpStringIteratorDone");
+    if (done === @undefined)
+        @throwTypeError("%RegExpStringIteratorPrototype%.next requires |this| to be an RegExp String Iterator instance");
+
+    if (done)
+        return { value: @undefined, done: true };
+
+    let regExp = @getByIdDirectPrivate(this, "regExpStringIteratorRegExp");
+    let string = @getByIdDirectPrivate(this, "regExpStringIteratorString");
+    let global = @getByIdDirectPrivate(this, "regExpStringIteratorGlobal");
+    let fullUnicode = @getByIdDirectPrivate(this, "regExpStringIteratorUnicode");
+    let match = @regExpExec(regExp, string);
+    if (match === null) {
+        @putByIdDirectPrivate(this, "regExpStringIteratorDone", true);
+        return { value: @undefined, done: true };
+    }
+
+    if (global) {
+        let matchStr = @toString(match[0]);
+        if (matchStr === "") {
+            let thisIndex = @toLength(regExp.lastIndex);
+            regExp.lastIndex = @advanceStringIndex(string, thisIndex, fullUnicode);
+        }
+    } else
+        @putByIdDirectPrivate(this, "regExpStringIteratorDone", true);
+
+    return { value: match, done: false };
+}
index a650add..ade519d 100644 (file)
@@ -25,7 +25,7 @@
 
 @constructor
 @globalPrivate
-function createSetIterator(iteratedObject, kind)
+function SetIterator(iteratedObject, kind)
 {
     "use strict";
 
@@ -42,7 +42,7 @@ function values()
     if (!@isSet(this))
         @throwTypeError("Set.prototype.values requires that |this| be Set");
 
-    return new @createSetIterator(this, @iterationKindValue);
+    return new @SetIterator(this, @iterationKindValue);
 }
 
 function entries()
@@ -52,7 +52,7 @@ function entries()
     if (!@isSet(this))
         @throwTypeError("Set.prototype.entries requires that |this| be Set");
 
-    return new @createSetIterator(this, @iterationKindKeyValue);
+    return new @SetIterator(this, @iterationKindKeyValue);
 }
 
 function forEach(callback /*, thisArg */)
index 1ca93c5..274812f 100644 (file)
@@ -43,6 +43,24 @@ function match(regexp)
     return createdRegExp.@matchSymbol(thisString);
 }
 
+function matchAll(arg)
+{
+    "use strict";
+
+    if (@isUndefinedOrNull(this))
+        @throwTypeError("String.prototype.matchAll requires |this| not to be null nor undefined");
+
+    if (!@isUndefinedOrNull(arg)) {
+        let matcher = arg.@matchAllSymbol;
+        if (!@isUndefinedOrNull(matcher))
+            return matcher.@call(arg, this);
+    }
+
+    let string = @toString(this);
+    let regExp = @regExpCreate(arg, "g");
+    return regExp.@matchAllSymbol(string);
+}
+
 @globalPrivate
 function repeatSlowPath(string, count)
 {
index f5faa6d..bf86432 100644 (file)
@@ -72,21 +72,21 @@ function values()
 {
     "use strict";
     @typedArrayLength(this);
-    return new @createArrayIterator(this, "value", @arrayIteratorValueNext);
+    return new @ArrayIterator(this, "value", @arrayIteratorValueNext);
 }
 
 function keys()
 {
     "use strict";
     @typedArrayLength(this);
-    return new @createArrayIterator(this, "key", @arrayIteratorKeyNext);
+    return new @ArrayIterator(this, "key", @arrayIteratorKeyNext);
 }
 
 function entries()
 {
     "use strict";
     @typedArrayLength(this);
-    return new @createArrayIterator(this, "key+value", @arrayIteratorKeyValueNext);
+    return new @ArrayIterator(this, "key+value", @arrayIteratorKeyValueNext);
 }
 
 function every(callback /*, thisArg */)
index ab203b5..0605910 100644 (file)
     macro(asyncIterator) \
     macro(iterator) \
     macro(match) \
+    macro(matchAll) \
     macro(replace) \
     macro(search) \
     macro(species) \
index 3c98dfb..2f948b2 100644 (file)
 #include "RegExpMatchesArray.h"
 #include "RegExpObject.h"
 #include "RegExpPrototype.h"
+#include "RegExpStringIteratorPrototype.h"
 #include "ScopedArguments.h"
 #include "SetConstructor.h"
 #include "SetIteratorPrototype.h"
@@ -938,24 +939,27 @@ putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Construct
     JSObject* regExpSymbolReplace = asObject(m_regExpPrototype->getDirect(vm, vm.propertyNames->replaceSymbol).asCell());
     m_regExpProtoSymbolReplace.set(vm, this, regExpSymbolReplace);
 
-#define CREATE_PRIVATE_GLOBAL_FUNCTION(name, code) JSFunction* name ## PrivateFunction = JSFunction::create(vm, code ## CodeGenerator(vm), this);
+#define CREATE_PRIVATE_GLOBAL_FUNCTION(varName, funcName, code) JSFunction* varName ## PrivateFunction = JSFunction::create(vm, code ## CodeGenerator(vm), this);
     JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(CREATE_PRIVATE_GLOBAL_FUNCTION)
 #undef CREATE_PRIVATE_GLOBAL_FUNCTION
 
     JSObject* arrayIteratorPrototype = ArrayIteratorPrototype::create(vm, this, ArrayIteratorPrototype::createStructure(vm, this, m_iteratorPrototype.get()));
-    createArrayIteratorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, arrayIteratorPrototype);
+    arrayIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, arrayIteratorPrototype);
 
     JSObject* asyncFromSyncIteratorPrototype = AsyncFromSyncIteratorPrototype::create(vm, this, AsyncFromSyncIteratorPrototype::createStructure(vm, this, m_iteratorPrototype.get()));
-    AsyncFromSyncIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, asyncFromSyncIteratorPrototype);
+    asyncFromSyncIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, asyncFromSyncIteratorPrototype);
 
     JSObject* mapIteratorPrototype = MapIteratorPrototype::create(vm, this, MapIteratorPrototype::createStructure(vm, this, m_iteratorPrototype.get()));
-    createMapIteratorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, mapIteratorPrototype);
+    mapIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, mapIteratorPrototype);
+
+    JSObject* regExpStringIteratorPrototype = RegExpStringIteratorPrototype::create(vm, this, RegExpStringIteratorPrototype::createStructure(vm, this, m_iteratorPrototype.get()));
+    regExpStringIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, regExpStringIteratorPrototype);
 
     JSObject* setIteratorPrototype = SetIteratorPrototype::create(vm, this, SetIteratorPrototype::createStructure(vm, this, m_iteratorPrototype.get()));
-    createSetIteratorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, setIteratorPrototype);
+    setIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, setIteratorPrototype);
 
     GlobalPropertyInfo staticGlobals[] = {
-#define INIT_PRIVATE_GLOBAL(name, code) GlobalPropertyInfo(vm.propertyNames->builtinNames().name ## PrivateName(), name ## PrivateFunction, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
+#define INIT_PRIVATE_GLOBAL(varName, funcName, code) GlobalPropertyInfo(vm.propertyNames->builtinNames().funcName ## PrivateName(), varName ## PrivateFunction, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
         JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(INIT_PRIVATE_GLOBAL)
 #undef INIT_PRIVATE_GLOBAL
         GlobalPropertyInfo(vm.propertyNames->NaN, jsNaN(), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
index 5cc819d..ed8049b 100644 (file)
@@ -77,6 +77,7 @@ void RegExpPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
     JSC_NATIVE_GETTER_WITHOUT_TRANSITION(vm.propertyNames->source, regExpProtoGetterSource, PropertyAttribute::DontEnum | PropertyAttribute::Accessor);
     JSC_NATIVE_GETTER_WITHOUT_TRANSITION(vm.propertyNames->flags, regExpProtoGetterFlags, PropertyAttribute::DontEnum | PropertyAttribute::Accessor);
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->matchSymbol, regExpPrototypeMatchCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
+    JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->matchAllSymbol, regExpPrototypeMatchAllCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->replaceSymbol, regExpPrototypeReplaceCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->searchSymbol, regExpPrototypeSearchCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->splitSymbol, regExpPrototypeSplitCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
diff --git a/Source/JavaScriptCore/runtime/RegExpStringIteratorPrototype.cpp b/Source/JavaScriptCore/runtime/RegExpStringIteratorPrototype.cpp
new file mode 100644 (file)
index 0000000..b33afc3
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2019 Alexey Shvayka <shvaikalesh@gmail.com>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "RegExpStringIteratorPrototype.h"
+
+#include "IteratorOperations.h"
+#include "JSCBuiltins.h"
+#include "JSCInlines.h"
+#include "JSCJSValueInlines.h"
+#include "JSCellInlines.h"
+#include "JSGlobalObject.h"
+#include "ObjectConstructor.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+const ClassInfo RegExpStringIteratorPrototype::s_info = { "RegExp String Iterator", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(RegExpStringIteratorPrototype) };
+
+void RegExpStringIteratorPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(vm, info()));
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(&vm, "RegExp String Iterator"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->next, regExpStringIteratorPrototypeNextCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
+    didBecomePrototype();
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/RegExpStringIteratorPrototype.h b/Source/JavaScriptCore/runtime/RegExpStringIteratorPrototype.h
new file mode 100644 (file)
index 0000000..a4377a1
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2019 Alexey Shvayka <shvaikalesh@gmail.com>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "JSObject.h"
+
+namespace JSC {
+
+class RegExpStringIteratorPrototype final : public JSNonFinalObject {
+public:
+    using Base = JSNonFinalObject;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static RegExpStringIteratorPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
+    {
+        auto prototype = new (NotNull, allocateCell<RegExpStringIteratorPrototype>(vm.heap)) RegExpStringIteratorPrototype(vm, structure);
+        prototype->finishCreation(vm, globalObject);
+        return prototype;
+    }
+
+    DECLARE_INFO;
+
+    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+    {
+        return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+    }
+
+private:
+    RegExpStringIteratorPrototype(VM& vm, Structure* structure)
+        : Base(vm, structure)
+    {
+    }
+
+    void finishCreation(VM&, JSGlobalObject*);
+};
+
+} // namespace JSC
index f4db8fd..8923883 100644 (file)
@@ -98,6 +98,7 @@ const ClassInfo StringPrototype::s_info = { "String", &StringObject::s_info, &st
 @begin stringPrototypeTable
     concat    JSBuiltin    DontEnum|Function 1
     match     JSBuiltin    DontEnum|Function 1
+    matchAll  JSBuiltin    DontEnum|Function 1
     padStart  JSBuiltin    DontEnum|Function 1
     padEnd    JSBuiltin    DontEnum|Function 1
     repeat    JSBuiltin    DontEnum|Function 1