Changeset 246567 in webkit
- Timestamp:
- Jun 18, 2019 2:21:48 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r246553 r246567 1 2019-06-18 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 [ESNExt] String.prototype.matchAll 4 https://bugs.webkit.org/show_bug.cgi?id=186694 5 6 Reviewed by Yusuke Suzuki. 7 8 Implement String.prototype.matchAll. 9 (https://tc39.es/ecma262/#sec-string.prototype.matchall) 10 11 * test262/config.yaml: 12 1 13 2019-06-18 Tadeu Zagallo <tzagallo@apple.com> 2 14 -
trunk/JSTests/test262/config.yaml
r245869 r246567 13 13 # https://bugs.webkit.org/show_bug.cgi?id=166693 14 14 - async-iteration 15 # https://bugs.webkit.org/show_bug.cgi?id=18669416 - String.prototype.matchAll17 - Symbol.matchAll18 15 # https://bugs.webkit.org/show_bug.cgi?id=174931 19 16 - regexp-lookbehind -
trunk/LayoutTests/ChangeLog
r246565 r246567 1 2019-06-18 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 [ESNExt] String.prototype.matchAll 4 https://bugs.webkit.org/show_bug.cgi?id=186694 5 6 Reviewed by Yusuke Suzuki. 7 8 Implement String.prototype.matchAll. 9 (https://tc39.es/ecma262/#sec-string.prototype.matchall) 10 11 * js/Object-getOwnPropertyNames-expected.txt: 12 * js/script-tests/Object-getOwnPropertyNames.js: 13 1 14 2019-06-18 Keith Miller <keith_miller@apple.com> 2 15 -
trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt
r235589 r246567 50 50 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'] 51 51 PASS getSortedOwnPropertyNames(String) is ['fromCharCode', 'fromCodePoint', 'length', 'name', 'prototype', 'raw'] 52 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']52 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'] 53 53 PASS getSortedOwnPropertyNames(Boolean) is ['length', 'name', 'prototype'] 54 54 PASS getSortedOwnPropertyNames(Boolean.prototype) is ['constructor', 'toString', 'valueOf'] … … 63 63 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'] 64 64 PASS getSortedOwnPropertyNames(JSON) is ['parse', 'stringify'] 65 PASS getSortedOwnPropertyNames(Symbol) is ['asyncIterator','for', 'hasInstance', 'isConcatSpreadable', 'iterator', 'keyFor', 'length', 'match', ' name', 'prototype', 'replace', 'search', 'species', 'split', 'toPrimitive', 'toStringTag', 'unscopables']65 PASS getSortedOwnPropertyNames(Symbol) is ['asyncIterator','for', 'hasInstance', 'isConcatSpreadable', 'iterator', 'keyFor', 'length', 'match', 'matchAll', 'name', 'prototype', 'replace', 'search', 'species', 'split', 'toPrimitive', 'toStringTag', 'unscopables'] 66 66 PASS getSortedOwnPropertyNames(Symbol.prototype) is ['constructor', 'description', 'toString', 'valueOf'] 67 67 PASS getSortedOwnPropertyNames(Map) is ['length', 'name', 'prototype'] -
trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js
r235589 r246567 59 59 "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']", 60 60 "String": "['fromCharCode', 'fromCodePoint', 'length', 'name', 'prototype', 'raw']", 61 "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']",61 "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']", 62 62 "Boolean": "['length', 'name', 'prototype']", 63 63 "Boolean.prototype": "['constructor', 'toString', 'valueOf']", … … 72 72 "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']", 73 73 "JSON": "['parse', 'stringify']", 74 "Symbol": "['asyncIterator','for', 'hasInstance', 'isConcatSpreadable', 'iterator', 'keyFor', 'length', 'match', ' name', 'prototype', 'replace', 'search', 'species', 'split', 'toPrimitive', 'toStringTag', 'unscopables']",74 "Symbol": "['asyncIterator','for', 'hasInstance', 'isConcatSpreadable', 'iterator', 'keyFor', 'length', 'match', 'matchAll', 'name', 'prototype', 'replace', 'search', 'species', 'split', 'toPrimitive', 'toStringTag', 'unscopables']", 75 75 "Symbol.prototype": "['constructor', 'description', 'toString', 'valueOf']", 76 76 "Map": "['length', 'name', 'prototype']", -
trunk/Source/JavaScriptCore/CMakeLists.txt
r246126 r246567 89 89 runtime/RegExpConstructor.cpp 90 90 runtime/RegExpPrototype.cpp 91 runtime/RegExpStringIteratorPrototype.cpp 91 92 runtime/SetPrototype.cpp 92 93 runtime/StringConstructor.cpp … … 932 933 runtime/RegExpKey.h 933 934 runtime/RegExpObject.h 935 runtime/RegExpStringIteratorPrototype.h 934 936 runtime/RuntimeFlags.h 935 937 runtime/RuntimeType.h … … 1205 1207 ${JAVASCRIPTCORE_DIR}/builtins/ReflectObject.js 1206 1208 ${JAVASCRIPTCORE_DIR}/builtins/RegExpPrototype.js 1209 ${JAVASCRIPTCORE_DIR}/builtins/RegExpStringIteratorPrototype.js 1207 1210 ${JAVASCRIPTCORE_DIR}/builtins/SetIteratorPrototype.js 1208 1211 ${JAVASCRIPTCORE_DIR}/builtins/SetPrototype.js -
trunk/Source/JavaScriptCore/ChangeLog
r246565 r246567 1 2019-06-18 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 [ESNExt] String.prototype.matchAll 4 https://bugs.webkit.org/show_bug.cgi?id=186694 5 6 Reviewed by Yusuke Suzuki. 7 8 Implement String.prototype.matchAll. 9 (https://tc39.es/ecma262/#sec-string.prototype.matchall) 10 11 Also rename @globalPrivate @constructor functions and C++ variables holding them. 12 13 Shipping in Chrome since version 73. 14 Shipping in Firefox since version 67. 15 16 * CMakeLists.txt: 17 * DerivedSources-input.xcfilelist: 18 * DerivedSources.make: 19 * JavaScriptCore.xcodeproj/project.pbxproj: 20 * Scripts/wkbuiltins/builtins_generate_combined_header.py: 21 (get_var_name): 22 (generate_section_for_global_private_code_name_macro): 23 * Sources.txt: 24 * builtins/ArrayPrototype.js: 25 (globalPrivate.ArrayIterator): 26 (values): 27 (keys): 28 (entries): 29 (globalPrivate.createArrayIterator): Deleted. 30 * builtins/AsyncFromSyncIteratorPrototype.js: 31 (globalPrivate.createAsyncFromSyncIterator): 32 (globalPrivate.AsyncFromSyncIterator): 33 (globalPrivate.AsyncFromSyncIteratorConstructor): Deleted. 34 * builtins/BuiltinNames.h: 35 * builtins/MapPrototype.js: 36 (globalPrivate.MapIterator): 37 (values): 38 (keys): 39 (entries): 40 (globalPrivate.createMapIterator): Deleted. 41 * builtins/RegExpPrototype.js: 42 (globalPrivate.RegExpStringIterator): 43 (overriddenName.string_appeared_here.matchAll): 44 * builtins/RegExpStringIteratorPrototype.js: Added. 45 (next): 46 * builtins/SetPrototype.js: 47 (globalPrivate.SetIterator): 48 (values): 49 (entries): 50 (globalPrivate.createSetIterator): Deleted. 51 * builtins/StringPrototype.js: 52 (matchAll): 53 * builtins/TypedArrayPrototype.js: 54 (values): 55 (keys): 56 (entries): 57 * runtime/CommonIdentifiers.h: 58 * runtime/JSGlobalObject.cpp: 59 (JSC::JSGlobalObject::init): 60 * runtime/RegExpPrototype.cpp: 61 (JSC::RegExpPrototype::finishCreation): 62 * runtime/RegExpStringIteratorPrototype.cpp: Added. 63 (JSC::RegExpStringIteratorPrototype::finishCreation): 64 * runtime/RegExpStringIteratorPrototype.h: Added. 65 * runtime/StringPrototype.cpp: 66 1 67 2019-06-18 Keith Miller <keith_miller@apple.com> 2 68 -
trunk/Source/JavaScriptCore/DerivedSources-input.xcfilelist
r244100 r246567 50 50 $(PROJECT_DIR)/builtins/ReflectObject.js 51 51 $(PROJECT_DIR)/builtins/RegExpPrototype.js 52 $(PROJECT_DIR)/builtins/RegExpStringIteratorPrototype.js 52 53 $(PROJECT_DIR)/builtins/SetIteratorPrototype.js 53 54 $(PROJECT_DIR)/builtins/SetPrototype.js -
trunk/Source/JavaScriptCore/DerivedSources.make
r243011 r246567 112 112 $(JavaScriptCore)/builtins/ReflectObject.js \ 113 113 $(JavaScriptCore)/builtins/RegExpPrototype.js \ 114 ${JavaScriptCore}/builtins/RegExpStringIteratorPrototype.js \ 114 115 $(JavaScriptCore)/builtins/SetIteratorPrototype.js \ 115 116 $(JavaScriptCore)/builtins/SetPrototype.js \ -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r246565 r246567 3926 3926 7E4EE7080EBB7963005934AA /* StructureChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureChain.h; sourceTree = "<group>"; }; 3927 3927 7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructureChain.cpp; sourceTree = "<group>"; }; 3928 84925A9A22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpStringIteratorPrototype.cpp; sourceTree = "<group>"; }; 3929 84925A9B22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpStringIteratorPrototype.h; sourceTree = "<group>"; }; 3930 84925A9C22B30CC800D1DFFF /* RegExpStringIteratorPrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = RegExpStringIteratorPrototype.js; sourceTree = "<group>"; }; 3928 3931 860161DF0F3A83C100F84710 /* AbstractMacroAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractMacroAssembler.h; sourceTree = "<group>"; }; 3929 3932 860161E00F3A83C100F84710 /* MacroAssemblerX86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86.h; sourceTree = "<group>"; }; … … 7260 7263 BCD202BF0E1706A7002C7E82 /* RegExpPrototype.cpp */, 7261 7264 BCD202C00E1706A7002C7E82 /* RegExpPrototype.h */, 7265 84925A9A22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.cpp */, 7266 84925A9B22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.h */, 7262 7267 70B0A9D01A9B66200001306A /* RuntimeFlags.h */, 7263 7268 527773DD1AAF83AC00BDE7E8 /* RuntimeType.cpp */, … … 8349 8354 7CF9BC5F1B65D9B1009DB1EF /* ReflectObject.js */, 8350 8355 654788421C937D2C000781A0 /* RegExpPrototype.js */, 8356 84925A9C22B30CC800D1DFFF /* RegExpStringIteratorPrototype.js */, 8351 8357 7035587D1C418419004BD7BF /* SetPrototype.js */, 8352 8358 7CF9BC601B65D9B1009DB1EF /* StringConstructor.js */, -
trunk/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_combined_header.py
r240718 r246567 34 34 from builtins_templates import BuiltinsGeneratorTemplates as Templates 35 35 36 37 def get_var_name(function): 38 var_name = function.function_name 39 if function.is_constructor: 40 return var_name[:1].lower() + var_name[1:] + 'Constructor' 41 return var_name 42 36 43 log = logging.getLogger('global') 37 38 44 39 45 class BuiltinsCombinedHeaderGenerator(BuiltinsGenerator): … … 165 171 for function in functions: 166 172 function_args = { 173 'varName': get_var_name(function), 167 174 'funcName': function.function_name, 168 175 'codeName': BuiltinsGenerator.mangledNameForFunction(function), 169 176 } 170 177 171 lines.append(" macro(%( funcName)s, %(codeName)s) \\" % function_args)178 lines.append(" macro(%(varName)s, %(funcName)s, %(codeName)s) \\" % function_args) 172 179 173 180 return '\n'.join(lines) -
trunk/Source/JavaScriptCore/Sources.txt
r246565 r246567 923 923 runtime/RegExpObject.cpp 924 924 runtime/RegExpPrototype.cpp 925 runtime/RegExpStringIteratorPrototype.cpp 925 926 runtime/RuntimeType.cpp 926 927 runtime/SamplingCounter.cpp -
trunk/Source/JavaScriptCore/builtins/ArrayPrototype.js
r239761 r246567 27 27 @constructor 28 28 @globalPrivate 29 function createArrayIterator(iteratedObject, kind, iterationFunction)29 function ArrayIterator(iteratedObject, kind, iterationFunction) 30 30 { 31 31 "use strict"; … … 42 42 "use strict"; 43 43 44 return new @ createArrayIterator(@toObject(this, "Array.prototype.values requires that |this| not be null or undefined"), "value", @arrayIteratorValueNext);44 return new @ArrayIterator(@toObject(this, "Array.prototype.values requires that |this| not be null or undefined"), "value", @arrayIteratorValueNext); 45 45 } 46 46 … … 49 49 "use strict"; 50 50 51 return new @ createArrayIterator(@toObject(this, "Array.prototype.keys requires that |this| not be null or undefined"), "key", @arrayIteratorKeyNext);51 return new @ArrayIterator(@toObject(this, "Array.prototype.keys requires that |this| not be null or undefined"), "key", @arrayIteratorKeyNext); 52 52 } 53 53 … … 56 56 "use strict"; 57 57 58 return new @ createArrayIterator(@toObject(this, "Array.prototype.entries requires that |this| not be null or undefined"), "key+value", @arrayIteratorKeyValueNext);58 return new @ArrayIterator(@toObject(this, "Array.prototype.entries requires that |this| not be null or undefined"), "key+value", @arrayIteratorKeyValueNext); 59 59 } 60 60 -
trunk/Source/JavaScriptCore/builtins/AsyncFromSyncIteratorPrototype.js
r242365 r246567 157 157 @throwTypeError('Only objects can be wrapped by async-from-sync wrapper'); 158 158 159 return new @AsyncFromSyncIterator Constructor(syncIterator, nextMethod);159 return new @AsyncFromSyncIterator(syncIterator, nextMethod); 160 160 } 161 161 162 162 @globalPrivate 163 163 @constructor 164 function AsyncFromSyncIterator Constructor(syncIterator, nextMethod)164 function AsyncFromSyncIterator(syncIterator, nextMethod) 165 165 { 166 166 "use strict"; -
trunk/Source/JavaScriptCore/builtins/BuiltinNames.h
r242382 r246567 165 165 macro(regExpSplitFast) \ 166 166 macro(regExpTestFast) \ 167 macro(regExpStringIteratorRegExp) \ 168 macro(regExpStringIteratorString) \ 169 macro(regExpStringIteratorGlobal) \ 170 macro(regExpStringIteratorUnicode) \ 171 macro(regExpStringIteratorDone) \ 167 172 macro(stringIncludesInternal) \ 168 173 macro(stringSplitFast) \ -
trunk/Source/JavaScriptCore/builtins/MapPrototype.js
r230459 r246567 26 26 @constructor 27 27 @globalPrivate 28 function createMapIterator(iteratedObject, kind)28 function MapIterator(iteratedObject, kind) 29 29 { 30 30 "use strict"; … … 43 43 @throwTypeError("Map.prototype.values requires that |this| be Map"); 44 44 45 return new @ createMapIterator(this, @iterationKindValue);45 return new @MapIterator(this, @iterationKindValue); 46 46 } 47 47 … … 53 53 @throwTypeError("Map.prototype.keys requires that |this| be Map"); 54 54 55 return new @ createMapIterator(this, @iterationKindKey);55 return new @MapIterator(this, @iterationKindKey); 56 56 } 57 57 … … 63 63 @throwTypeError("Map.prototype.entries requires that |this| be Map"); 64 64 65 return new @ createMapIterator(this, @iterationKindKeyValue);65 return new @MapIterator(this, @iterationKindKeyValue); 66 66 } 67 67 -
trunk/Source/JavaScriptCore/builtins/RegExpPrototype.js
r238267 r246567 25 25 26 26 @globalPrivate 27 @constructor 28 function RegExpStringIterator(regExp, string, global, fullUnicode) 29 { 30 "use strict"; 31 32 @putByIdDirectPrivate(this, "regExpStringIteratorRegExp", regExp); 33 @putByIdDirectPrivate(this, "regExpStringIteratorString", string); 34 @putByIdDirectPrivate(this, "regExpStringIteratorGlobal", global); 35 @putByIdDirectPrivate(this, "regExpStringIteratorUnicode", fullUnicode); 36 @putByIdDirectPrivate(this, "regExpStringIteratorDone", false); 37 } 38 39 @globalPrivate 27 40 function advanceStringIndex(string, index, unicode) 28 41 { … … 141 154 return @regExpMatchFast.@call(this, str); 142 155 return @matchSlow(this, str); 156 } 157 158 @overriddenName="[Symbol.matchAll]" 159 function matchAll(strArg) 160 { 161 "use strict"; 162 163 let regExp = this; 164 if (!@isObject(regExp)) 165 @throwTypeError("RegExp.prototype.@@matchAll requires |this| to be an Object"); 166 167 let string = @toString(strArg); 168 let Matcher = @speciesConstructor(regExp, @RegExp); 169 170 let flags = @toString(regExp.flags); 171 let matcher = new Matcher(regExp, flags); 172 matcher.lastIndex = @toLength(regExp.lastIndex); 173 174 let global = @stringIncludesInternal.@call(flags, "g"); 175 let fullUnicode = @stringIncludesInternal.@call(flags, "u"); 176 177 return new @RegExpStringIterator(matcher, string, global, fullUnicode); 143 178 } 144 179 -
trunk/Source/JavaScriptCore/builtins/SetPrototype.js
r230459 r246567 26 26 @constructor 27 27 @globalPrivate 28 function createSetIterator(iteratedObject, kind)28 function SetIterator(iteratedObject, kind) 29 29 { 30 30 "use strict"; … … 43 43 @throwTypeError("Set.prototype.values requires that |this| be Set"); 44 44 45 return new @ createSetIterator(this, @iterationKindValue);45 return new @SetIterator(this, @iterationKindValue); 46 46 } 47 47 … … 53 53 @throwTypeError("Set.prototype.entries requires that |this| be Set"); 54 54 55 return new @ createSetIterator(this, @iterationKindKeyValue);55 return new @SetIterator(this, @iterationKindKeyValue); 56 56 } 57 57 -
trunk/Source/JavaScriptCore/builtins/StringPrototype.js
r242047 r246567 44 44 } 45 45 46 function matchAll(arg) 47 { 48 "use strict"; 49 50 if (@isUndefinedOrNull(this)) 51 @throwTypeError("String.prototype.matchAll requires |this| not to be null nor undefined"); 52 53 if (!@isUndefinedOrNull(arg)) { 54 let matcher = arg.@matchAllSymbol; 55 if (!@isUndefinedOrNull(matcher)) 56 return matcher.@call(arg, this); 57 } 58 59 let string = @toString(this); 60 let regExp = @regExpCreate(arg, "g"); 61 return regExp.@matchAllSymbol(string); 62 } 63 46 64 @globalPrivate 47 65 function repeatSlowPath(string, count) -
trunk/Source/JavaScriptCore/builtins/TypedArrayPrototype.js
r239761 r246567 73 73 "use strict"; 74 74 @typedArrayLength(this); 75 return new @ createArrayIterator(this, "value", @arrayIteratorValueNext);75 return new @ArrayIterator(this, "value", @arrayIteratorValueNext); 76 76 } 77 77 … … 80 80 "use strict"; 81 81 @typedArrayLength(this); 82 return new @ createArrayIterator(this, "key", @arrayIteratorKeyNext);82 return new @ArrayIterator(this, "key", @arrayIteratorKeyNext); 83 83 } 84 84 … … 87 87 "use strict"; 88 88 @typedArrayLength(this); 89 return new @ createArrayIterator(this, "key+value", @arrayIteratorKeyValueNext);89 return new @ArrayIterator(this, "key+value", @arrayIteratorKeyValueNext); 90 90 } 91 91 -
trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h
r246565 r246567 256 256 macro(iterator) \ 257 257 macro(match) \ 258 macro(matchAll) \ 258 259 macro(replace) \ 259 260 macro(search) \ -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r246565 r246567 157 157 #include "RegExpObject.h" 158 158 #include "RegExpPrototype.h" 159 #include "RegExpStringIteratorPrototype.h" 159 160 #include "ScopedArguments.h" 160 161 #include "SetConstructor.h" … … 939 940 m_regExpProtoSymbolReplace.set(vm, this, regExpSymbolReplace); 940 941 941 #define CREATE_PRIVATE_GLOBAL_FUNCTION( name, code) JSFunction* name ## PrivateFunction = JSFunction::create(vm, code ## CodeGenerator(vm), this);942 #define CREATE_PRIVATE_GLOBAL_FUNCTION(varName, funcName, code) JSFunction* varName ## PrivateFunction = JSFunction::create(vm, code ## CodeGenerator(vm), this); 942 943 JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(CREATE_PRIVATE_GLOBAL_FUNCTION) 943 944 #undef CREATE_PRIVATE_GLOBAL_FUNCTION 944 945 945 946 JSObject* arrayIteratorPrototype = ArrayIteratorPrototype::create(vm, this, ArrayIteratorPrototype::createStructure(vm, this, m_iteratorPrototype.get())); 946 createArrayIteratorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, arrayIteratorPrototype);947 arrayIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, arrayIteratorPrototype); 947 948 948 949 JSObject* asyncFromSyncIteratorPrototype = AsyncFromSyncIteratorPrototype::create(vm, this, AsyncFromSyncIteratorPrototype::createStructure(vm, this, m_iteratorPrototype.get())); 949 AsyncFromSyncIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, asyncFromSyncIteratorPrototype);950 asyncFromSyncIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, asyncFromSyncIteratorPrototype); 950 951 951 952 JSObject* mapIteratorPrototype = MapIteratorPrototype::create(vm, this, MapIteratorPrototype::createStructure(vm, this, m_iteratorPrototype.get())); 952 createMapIteratorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, mapIteratorPrototype); 953 mapIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, mapIteratorPrototype); 954 955 JSObject* regExpStringIteratorPrototype = RegExpStringIteratorPrototype::create(vm, this, RegExpStringIteratorPrototype::createStructure(vm, this, m_iteratorPrototype.get())); 956 regExpStringIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, regExpStringIteratorPrototype); 953 957 954 958 JSObject* setIteratorPrototype = SetIteratorPrototype::create(vm, this, SetIteratorPrototype::createStructure(vm, this, m_iteratorPrototype.get())); 955 createSetIteratorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, setIteratorPrototype);959 setIteratorConstructorPrivateFunction->putDirect(vm, vm.propertyNames->prototype, setIteratorPrototype); 956 960 957 961 GlobalPropertyInfo staticGlobals[] = { 958 #define INIT_PRIVATE_GLOBAL( name, code) GlobalPropertyInfo(vm.propertyNames->builtinNames().name ## PrivateName(), name ## PrivateFunction, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),962 #define INIT_PRIVATE_GLOBAL(varName, funcName, code) GlobalPropertyInfo(vm.propertyNames->builtinNames().funcName ## PrivateName(), varName ## PrivateFunction, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly), 959 963 JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(INIT_PRIVATE_GLOBAL) 960 964 #undef INIT_PRIVATE_GLOBAL -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r245082 r246567 78 78 JSC_NATIVE_GETTER_WITHOUT_TRANSITION(vm.propertyNames->flags, regExpProtoGetterFlags, PropertyAttribute::DontEnum | PropertyAttribute::Accessor); 79 79 JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->matchSymbol, regExpPrototypeMatchCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum)); 80 JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->matchAllSymbol, regExpPrototypeMatchAllCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum)); 80 81 JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->replaceSymbol, regExpPrototypeReplaceCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum)); 81 82 JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->searchSymbol, regExpPrototypeSearchCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum)); -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r245194 r246567 99 99 concat JSBuiltin DontEnum|Function 1 100 100 match JSBuiltin DontEnum|Function 1 101 matchAll JSBuiltin DontEnum|Function 1 101 102 padStart JSBuiltin DontEnum|Function 1 102 103 padEnd JSBuiltin DontEnum|Function 1
Note: See TracChangeset
for help on using the changeset viewer.