Changeset 281369 in webkit
- Timestamp:
- Aug 21, 2021 5:10:09 AM (11 months ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/unscopables.js (modified) (1 diff)
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/model/remote-object-get-properties-expected.txt (modified) (4 diffs)
-
LayoutTests/js/Object-getOwnPropertyNames-expected.txt (modified) (1 diff)
-
LayoutTests/js/array-unscopables-properties-expected.txt (modified) (1 diff)
-
LayoutTests/js/script-tests/Object-getOwnPropertyNames.js (modified) (1 diff)
-
LayoutTests/js/script-tests/array-unscopables-properties.js (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/ArrayPrototype.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/runtime/OptionsList.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r281156 r281369 1 2021-08-21 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Enable Array#findLast method 4 https://bugs.webkit.org/show_bug.cgi?id=229355 5 6 Reviewed by Saam Barati. 7 8 * stress/unscopables.js: 9 1 10 2021-08-17 Mikhail R. Gadelha <mikhail@igalia.com> 2 11 -
trunk/JSTests/stress/unscopables.js
r268760 r281369 12 12 test(typeof unscopables, "object"); 13 13 test(unscopables.__proto__, undefined); 14 test(String(Object.keys(unscopables).sort()), "at,copyWithin,entries,fill,find,findIndex,f lat,flatMap,includes,keys,values");14 test(String(Object.keys(unscopables).sort()), "at,copyWithin,entries,fill,find,findIndex,findLast,findLastIndex,flat,flatMap,includes,keys,values"); 15 15 }()); 16 16 -
trunk/LayoutTests/ChangeLog
r281367 r281369 1 2021-08-21 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Enable Array#findLast method 4 https://bugs.webkit.org/show_bug.cgi?id=229355 5 6 Reviewed by Saam Barati. 7 8 * inspector/model/remote-object-get-properties-expected.txt: 9 * js/Object-getOwnPropertyNames-expected.txt: 10 * js/array-unscopables-properties-expected.txt: 11 * js/script-tests/Object-getOwnPropertyNames.js: 12 * js/script-tests/array-unscopables-properties.js: 13 1 14 2021-08-21 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt
r280289 r281369 83 83 entries 84 84 find 85 findLast 85 86 findIndex 87 findLastIndex 86 88 includes 87 89 copyWithin … … 137 139 entries 138 140 find 141 findLast 139 142 findIndex 143 findLastIndex 140 144 includes 141 145 copyWithin … … 176 180 entries 177 181 find 182 findLast 178 183 findIndex 184 findLastIndex 179 185 includes 180 186 copyWithin … … 215 221 entries 216 222 find 223 findLast 217 224 findIndex 225 findLastIndex 218 226 includes 219 227 copyWithin -
trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt
r280289 r281369 48 48 PASS getSortedOwnPropertyNames(Function.prototype) is ['apply', 'arguments', 'bind', 'call', 'caller', 'constructor', 'length', 'name', 'toString'] 49 49 PASS getSortedOwnPropertyNames(Array) is ['from', 'isArray', 'length', 'name', 'of', 'prototype'] 50 PASS getSortedOwnPropertyNames(Array.prototype) is ['at', 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'f lat', 'flatMap', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']50 PASS getSortedOwnPropertyNames(Array.prototype) is ['at', 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'findLast', 'findLastIndex', '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 52 PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'at', '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', 'replaceAll', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimEnd', 'trimLeft', 'trimRight', 'trimStart', 'valueOf'] -
trunk/LayoutTests/js/array-unscopables-properties-expected.txt
r270550 r281369 35 35 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findIndex").enumerable is true 36 36 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findIndex").configurable is true 37 PASS Array.prototype[Symbol.unscopables]["findLast"] is true 38 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findLast").writable is true 39 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findLast").enumerable is true 40 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findLast").configurable is true 41 PASS Array.prototype[Symbol.unscopables]["findLastIndex"] is true 42 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findLastIndex").writable is true 43 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findLastIndex").enumerable is true 44 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findLastIndex").configurable is true 37 45 PASS Array.prototype[Symbol.unscopables]["flat"] is true 38 46 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "flat").writable is true -
trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js
r280289 r281369 57 57 "Function.prototype": "['apply', 'arguments', 'bind', 'call', 'caller', 'constructor', 'length', 'name', 'toString']", 58 58 "Array": "['from', 'isArray', 'length', 'name', 'of', 'prototype']", 59 "Array.prototype": "['at', 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'f lat', 'flatMap', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']",59 "Array.prototype": "['at', 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'findLast', 'findLastIndex', '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 61 "String.prototype": "['anchor', 'at', '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', 'replaceAll', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimEnd', 'trimLeft', 'trimRight', 'trimStart', 'valueOf']", -
trunk/LayoutTests/js/script-tests/array-unscopables-properties.js
r270550 r281369 14 14 "find", 15 15 "findIndex", 16 "findLast", 17 "findLastIndex", 16 18 "flat", 17 19 "flatMap", -
trunk/Source/JavaScriptCore/ChangeLog
r281355 r281369 1 2021-08-21 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Enable Array#findLast method 4 https://bugs.webkit.org/show_bug.cgi?id=229355 5 6 Reviewed by Saam Barati. 7 8 This patch enables Array#findLast and Array#findLastIndex methods. 9 10 * runtime/ArrayPrototype.cpp: Order of unscopables is alphabet ordering (https://tc39.es/ecma262/#sec-array.prototype-@@unscopables) 11 (JSC::ArrayPrototype::finishCreation): 12 * runtime/OptionsList.h: 13 1 14 2021-08-20 Yusuke Suzuki <ysuzuki@apple.com> 2 15 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r280761 r281369 128 128 unscopables->convertToDictionary(vm); 129 129 const Identifier* const unscopableNames[] = { 130 Options::useAtMethod() ? &vm.propertyNames->builtinNames().atPublicName() : nullptr, 130 131 &vm.propertyNames->builtinNames().copyWithinPublicName(), 131 132 &vm.propertyNames->builtinNames().entriesPublicName(), … … 133 134 &vm.propertyNames->builtinNames().findPublicName(), 134 135 &vm.propertyNames->builtinNames().findIndexPublicName(), 136 Options::useArrayFindLastMethod() ? &vm.propertyNames->builtinNames().findLastPublicName() : nullptr, 137 Options::useArrayFindLastMethod() ? &vm.propertyNames->builtinNames().findLastIndexPublicName() : nullptr, 135 138 &vm.propertyNames->builtinNames().flatPublicName(), 136 139 &vm.propertyNames->builtinNames().flatMapPublicName(), … … 139 142 &vm.propertyNames->builtinNames().valuesPublicName() 140 143 }; 141 if (Options::useArrayFindLastMethod()) { 142 unscopables->putDirect(vm, vm.propertyNames->builtinNames().findLastPublicName(), jsBoolean(true)); 143 unscopables->putDirect(vm, vm.propertyNames->builtinNames().findLastIndexPublicName(), jsBoolean(true)); 144 } 145 if (Options::useAtMethod()) 146 unscopables->putDirect(vm, vm.propertyNames->builtinNames().atPublicName(), jsBoolean(true)); 147 for (const auto* unscopableName : unscopableNames) 148 unscopables->putDirect(vm, *unscopableName, jsBoolean(true)); 144 for (const auto* unscopableName : unscopableNames) { 145 if (unscopableName) 146 unscopables->putDirect(vm, *unscopableName, jsBoolean(true)); 147 } 149 148 putDirectWithoutTransition(vm, vm.propertyNames->unscopablesSymbol, unscopables, PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly); 150 149 } -
trunk/Source/JavaScriptCore/runtime/OptionsList.h
r281178 r281369 554 554 v(Bool, useDataICSharing, false, Normal, nullptr) \ 555 555 v(Bool, useTemporal, false, Normal, "Expose the Temporal object.") \ 556 v(Bool, useArrayFindLastMethod, false, Normal, "Expose the findLast() and findLastIndex() methods on Array and %TypedArray%.") \556 v(Bool, useArrayFindLastMethod, true, Normal, "Expose the findLast() and findLastIndex() methods on Array and %TypedArray%.") \ 557 557 558 558
Note: See TracChangeset
for help on using the changeset viewer.