Changeset 267554 in webkit
- Timestamp:
- Sep 24, 2020, 7:51:45 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/typedarray-sort.js (modified) (1 diff)
-
JSTests/test262/expectations.yaml (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/builtins/TypedArrayPrototype.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r267549 r267554 1 2020-09-24 Ross Kirsling <ross.kirsling@sony.com> 2 3 %TypedArray%.prototype.sort must throw if comparator is defined and uncallable 4 https://bugs.webkit.org/show_bug.cgi?id=216952 5 6 Reviewed by Yusuke Suzuki. 7 8 * stress/typedarray-sort.js: 9 Fix test. 10 11 * test262/expectations.yaml: 12 Mark two test cases as passing. 13 1 14 2020-09-24 Ross Kirsling <ross.kirsling@sony.com> 2 15 -
trunk/JSTests/stress/typedarray-sort.js
r264304 r267554 50 50 51 51 debug("4.0 Wrong Type for Callback Test"); 52 should BeTrue("testPrototypeFunction('sort', '(8)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])");53 should BeTrue("testPrototypeFunction('sort', '(\"wrong\")', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])");54 should BeTrue("testPrototypeFunction('sort', '(new Object())', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])");55 should BeTrue("testPrototypeFunction('sort', '(null)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])");52 shouldThrow("testPrototypeFunction('sort', '(8)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])"); 53 shouldThrow("testPrototypeFunction('sort', '(\"wrong\")', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])"); 54 shouldThrow("testPrototypeFunction('sort', '(new Object())', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])"); 55 shouldThrow("testPrototypeFunction('sort', '(null)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])"); 56 56 debug(""); 57 57 finishJSTest(); -
trunk/JSTests/test262/expectations.yaml
r267549 r267554 1252 1252 default: 'TypeError: Underlying ArrayBuffer has been detached from the view (Testing with Float64Array.)' 1253 1253 strict mode: 'TypeError: Underlying ArrayBuffer has been detached from the view (Testing with Float64Array.)' 1254 test/built-ins/TypedArray/prototype/sort/comparefn-nonfunction-call-throws.js:1255 default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all (Testing with Float64Array.)'1256 strict mode: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all (Testing with Float64Array.)'1257 1254 test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js: 1258 1255 default: 'Test262Error: should not call valueOf if toString is present (Testing with Float64Array.)' -
trunk/Source/JavaScriptCore/ChangeLog
r267549 r267554 1 2020-09-24 Ross Kirsling <ross.kirsling@sony.com> 2 3 %TypedArray%.prototype.sort must throw if comparator is defined and uncallable 4 https://bugs.webkit.org/show_bug.cgi?id=216952 5 6 Reviewed by Yusuke Suzuki. 7 8 * builtins/TypedArrayPrototype.js: 9 (sort): 10 1 11 2020-09-24 Ross Kirsling <ross.kirsling@sony.com> 2 12 -
trunk/Source/JavaScriptCore/builtins/TypedArrayPrototype.js
r267549 r267554 218 218 } 219 219 220 var length = @typedArrayLength(this); 221 220 if (comparator !== @undefined && !@isCallable(comparator)) 221 @throwTypeError("TypedArray.prototype.sort requires the comparator argument to be a function or undefined"); 222 223 var length = @typedArrayLength(this); 222 224 if (length < 2) 223 225 return; 224 226 225 if ( @isCallable(comparator))227 if (comparator !== @undefined) 226 228 mergeSort(this, length, comparator); 227 229 else 228 230 @typedArraySort(this); 229 231 230 232 return this; 231 233 }
Note:
See TracChangeset
for help on using the changeset viewer.