Diff
Modified: trunk/JSTests/ChangeLog (246566 => 246567)
--- trunk/JSTests/ChangeLog 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/JSTests/ChangeLog 2019-06-18 21:21:48 UTC (rev 246567)
@@ -1,3 +1,15 @@
+2019-06-18 Alexey Shvayka <[email protected]>
+
+ [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 <[email protected]>
DFG code should not reify the names of builtin functions with private names
Modified: trunk/JSTests/test262/config.yaml (246566 => 246567)
--- trunk/JSTests/test262/config.yaml 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/JSTests/test262/config.yaml 2019-06-18 21:21:48 UTC (rev 246567)
@@ -12,9 +12,6 @@
- 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
Modified: trunk/LayoutTests/ChangeLog (246566 => 246567)
--- trunk/LayoutTests/ChangeLog 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/LayoutTests/ChangeLog 2019-06-18 21:21:48 UTC (rev 246567)
@@ -1,3 +1,16 @@
+2019-06-18 Alexey Shvayka <[email protected]>
+
+ [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 <[email protected]>
Add support for WeakRef
Modified: trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt (246566 => 246567)
--- trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt 2019-06-18 21:21:48 UTC (rev 246567)
@@ -49,7 +49,7 @@
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.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']
Modified: trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js (246566 => 246567)
--- trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js 2019-06-18 21:21:48 UTC (rev 246567)
@@ -58,7 +58,7 @@
"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 @@
"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']",
Modified: trunk/Source/_javascript_Core/CMakeLists.txt (246566 => 246567)
--- trunk/Source/_javascript_Core/CMakeLists.txt 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/CMakeLists.txt 2019-06-18 21:21:48 UTC (rev 246567)
@@ -88,6 +88,7 @@
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 @@
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 @@
${_javascript_CORE_DIR}/builtins/PromisePrototype.js
${_javascript_CORE_DIR}/builtins/ReflectObject.js
${_javascript_CORE_DIR}/builtins/RegExpPrototype.js
+ ${_javascript_CORE_DIR}/builtins/RegExpStringIteratorPrototype.js
${_javascript_CORE_DIR}/builtins/SetIteratorPrototype.js
${_javascript_CORE_DIR}/builtins/SetPrototype.js
${_javascript_CORE_DIR}/builtins/StringConstructor.js
Modified: trunk/Source/_javascript_Core/ChangeLog (246566 => 246567)
--- trunk/Source/_javascript_Core/ChangeLog 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-06-18 21:21:48 UTC (rev 246567)
@@ -1,3 +1,69 @@
+2019-06-18 Alexey Shvayka <[email protected]>
+
+ [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:
+ * _javascript_Core.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 <[email protected]>
Add support for WeakRef
Modified: trunk/Source/_javascript_Core/DerivedSources-input.xcfilelist (246566 => 246567)
--- trunk/Source/_javascript_Core/DerivedSources-input.xcfilelist 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/DerivedSources-input.xcfilelist 2019-06-18 21:21:48 UTC (rev 246567)
@@ -49,6 +49,7 @@
$(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
Modified: trunk/Source/_javascript_Core/DerivedSources.make (246566 => 246567)
--- trunk/Source/_javascript_Core/DerivedSources.make 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/DerivedSources.make 2019-06-18 21:21:48 UTC (rev 246567)
@@ -111,6 +111,7 @@
$(_javascript_Core)/builtins/PromisePrototype.js \
$(_javascript_Core)/builtins/ReflectObject.js \
$(_javascript_Core)/builtins/RegExpPrototype.js \
+ ${_javascript_Core}/builtins/RegExpStringIteratorPrototype.js \
$(_javascript_Core)/builtins/SetIteratorPrototype.js \
$(_javascript_Core)/builtins/SetPrototype.js \
$(_javascript_Core)/builtins/StringConstructor.js \
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (246566 => 246567)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2019-06-18 21:21:48 UTC (rev 246567)
@@ -3925,6 +3925,9 @@
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>"; };
@@ -7259,6 +7262,8 @@
0F7C39FC1C8F659500480151 /* RegExpObjectInlines.h */,
BCD202BF0E1706A7002C7E82 /* RegExpPrototype.cpp */,
BCD202C00E1706A7002C7E82 /* RegExpPrototype.h */,
+ 84925A9A22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.cpp */,
+ 84925A9B22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.h */,
70B0A9D01A9B66200001306A /* RuntimeFlags.h */,
527773DD1AAF83AC00BDE7E8 /* RuntimeType.cpp */,
52C0611D1AA51E1B00B4ADBA /* RuntimeType.h */,
@@ -8348,6 +8353,7 @@
7CFBAC1C18B535E500D00750 /* PromisePrototype.js */,
7CF9BC5F1B65D9B1009DB1EF /* ReflectObject.js */,
654788421C937D2C000781A0 /* RegExpPrototype.js */,
+ 84925A9C22B30CC800D1DFFF /* RegExpStringIteratorPrototype.js */,
7035587D1C418419004BD7BF /* SetPrototype.js */,
7CF9BC601B65D9B1009DB1EF /* StringConstructor.js */,
7CF9BC611B65D9B1009DB1EF /* StringIteratorPrototype.js */,
Modified: trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_combined_header.py (246566 => 246567)
--- trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_combined_header.py 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_combined_header.py 2019-06-18 21:21:48 UTC (rev 246567)
@@ -33,9 +33,15 @@
from builtins_generator import BuiltinsGenerator
from builtins_templates import BuiltinsGeneratorTemplates as Templates
+
+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):
BuiltinsGenerator.__init__(self, model)
@@ -164,10 +170,11 @@
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)
Modified: trunk/Source/_javascript_Core/Sources.txt (246566 => 246567)
--- trunk/Source/_javascript_Core/Sources.txt 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/Sources.txt 2019-06-18 21:21:48 UTC (rev 246567)
@@ -922,6 +922,7 @@
runtime/RegExpMatchesArray.cpp
runtime/RegExpObject.cpp
runtime/RegExpPrototype.cpp
+runtime/RegExpStringIteratorPrototype.cpp
runtime/RuntimeType.cpp
runtime/SamplingCounter.cpp
runtime/SamplingProfiler.cpp
Modified: trunk/Source/_javascript_Core/builtins/ArrayPrototype.js (246566 => 246567)
--- trunk/Source/_javascript_Core/builtins/ArrayPrototype.js 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/builtins/ArrayPrototype.js 2019-06-18 21:21:48 UTC (rev 246567)
@@ -26,7 +26,7 @@
@constructor
@globalPrivate
-function createArrayIterator(iteratedObject, kind, iterationFunction)
+function ArrayIterator(iteratedObject, kind, iterationFunction)
{
"use strict";
@@ -41,7 +41,7 @@
{
"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()
@@ -48,7 +48,7 @@
{
"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()
@@ -55,7 +55,7 @@
{
"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 */)
Modified: trunk/Source/_javascript_Core/builtins/AsyncFromSyncIteratorPrototype.js (246566 => 246567)
--- trunk/Source/_javascript_Core/builtins/AsyncFromSyncIteratorPrototype.js 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/builtins/AsyncFromSyncIteratorPrototype.js 2019-06-18 21:21:48 UTC (rev 246567)
@@ -156,12 +156,12 @@
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";
Modified: trunk/Source/_javascript_Core/builtins/BuiltinNames.h (246566 => 246567)
--- trunk/Source/_javascript_Core/builtins/BuiltinNames.h 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/builtins/BuiltinNames.h 2019-06-18 21:21:48 UTC (rev 246567)
@@ -164,6 +164,11 @@
macro(regExpSearchFast) \
macro(regExpSplitFast) \
macro(regExpTestFast) \
+ macro(regExpStringIteratorRegExp) \
+ macro(regExpStringIteratorString) \
+ macro(regExpStringIteratorGlobal) \
+ macro(regExpStringIteratorUnicode) \
+ macro(regExpStringIteratorDone) \
macro(stringIncludesInternal) \
macro(stringSplitFast) \
macro(stringSubstrInternal) \
Modified: trunk/Source/_javascript_Core/builtins/MapPrototype.js (246566 => 246567)
--- trunk/Source/_javascript_Core/builtins/MapPrototype.js 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/builtins/MapPrototype.js 2019-06-18 21:21:48 UTC (rev 246567)
@@ -25,7 +25,7 @@
@constructor
@globalPrivate
-function createMapIterator(iteratedObject, kind)
+function MapIterator(iteratedObject, kind)
{
"use strict";
@@ -42,7 +42,7 @@
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 @@
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 @@
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 */)
Modified: trunk/Source/_javascript_Core/builtins/RegExpPrototype.js (246566 => 246567)
--- trunk/Source/_javascript_Core/builtins/RegExpPrototype.js 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/builtins/RegExpPrototype.js 2019-06-18 21:21:48 UTC (rev 246567)
@@ -24,6 +24,19 @@
*/
@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 @@
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)
{
Added: trunk/Source/_javascript_Core/builtins/RegExpStringIteratorPrototype.js (0 => 246567)
--- trunk/Source/_javascript_Core/builtins/RegExpStringIteratorPrototype.js (rev 0)
+++ trunk/Source/_javascript_Core/builtins/RegExpStringIteratorPrototype.js 2019-06-18 21:21:48 UTC (rev 246567)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2019 Alexey Shvayka <[email protected]>.
+ *
+ * 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 };
+}
Modified: trunk/Source/_javascript_Core/builtins/SetPrototype.js (246566 => 246567)
--- trunk/Source/_javascript_Core/builtins/SetPrototype.js 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/builtins/SetPrototype.js 2019-06-18 21:21:48 UTC (rev 246567)
@@ -25,7 +25,7 @@
@constructor
@globalPrivate
-function createSetIterator(iteratedObject, kind)
+function SetIterator(iteratedObject, kind)
{
"use strict";
@@ -42,7 +42,7 @@
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 @@
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 */)
Modified: trunk/Source/_javascript_Core/builtins/StringPrototype.js (246566 => 246567)
--- trunk/Source/_javascript_Core/builtins/StringPrototype.js 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/builtins/StringPrototype.js 2019-06-18 21:21:48 UTC (rev 246567)
@@ -43,6 +43,24 @@
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)
{
Modified: trunk/Source/_javascript_Core/builtins/TypedArrayPrototype.js (246566 => 246567)
--- trunk/Source/_javascript_Core/builtins/TypedArrayPrototype.js 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/builtins/TypedArrayPrototype.js 2019-06-18 21:21:48 UTC (rev 246567)
@@ -72,7 +72,7 @@
{
"use strict";
@typedArrayLength(this);
- return new @createArrayIterator(this, "value", @arrayIteratorValueNext);
+ return new @ArrayIterator(this, "value", @arrayIteratorValueNext);
}
function keys()
@@ -79,7 +79,7 @@
{
"use strict";
@typedArrayLength(this);
- return new @createArrayIterator(this, "key", @arrayIteratorKeyNext);
+ return new @ArrayIterator(this, "key", @arrayIteratorKeyNext);
}
function entries()
@@ -86,7 +86,7 @@
{
"use strict";
@typedArrayLength(this);
- return new @createArrayIterator(this, "key+value", @arrayIteratorKeyValueNext);
+ return new @ArrayIterator(this, "key+value", @arrayIteratorKeyValueNext);
}
function every(callback /*, thisArg */)
Modified: trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h (246566 => 246567)
--- trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h 2019-06-18 21:21:48 UTC (rev 246567)
@@ -255,6 +255,7 @@
macro(asyncIterator) \
macro(iterator) \
macro(match) \
+ macro(matchAll) \
macro(replace) \
macro(search) \
macro(species) \
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (246566 => 246567)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2019-06-18 21:21:48 UTC (rev 246567)
@@ -156,6 +156,7 @@
#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 @@
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),
Modified: trunk/Source/_javascript_Core/runtime/RegExpPrototype.cpp (246566 => 246567)
--- trunk/Source/_javascript_Core/runtime/RegExpPrototype.cpp 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/runtime/RegExpPrototype.cpp 2019-06-18 21:21:48 UTC (rev 246567)
@@ -77,6 +77,7 @@
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));
Added: trunk/Source/_javascript_Core/runtime/RegExpStringIteratorPrototype.cpp (0 => 246567)
--- trunk/Source/_javascript_Core/runtime/RegExpStringIteratorPrototype.cpp (rev 0)
+++ trunk/Source/_javascript_Core/runtime/RegExpStringIteratorPrototype.cpp 2019-06-18 21:21:48 UTC (rev 246567)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2019 Alexey Shvayka <[email protected]>.
+ *
+ * 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
Added: trunk/Source/_javascript_Core/runtime/RegExpStringIteratorPrototype.h (0 => 246567)
--- trunk/Source/_javascript_Core/runtime/RegExpStringIteratorPrototype.h (rev 0)
+++ trunk/Source/_javascript_Core/runtime/RegExpStringIteratorPrototype.h 2019-06-18 21:21:48 UTC (rev 246567)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2019 Alexey Shvayka <[email protected]>.
+ *
+ * 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
Modified: trunk/Source/_javascript_Core/runtime/StringPrototype.cpp (246566 => 246567)
--- trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2019-06-18 21:11:30 UTC (rev 246566)
+++ trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2019-06-18 21:21:48 UTC (rev 246567)
@@ -98,6 +98,7 @@
@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