Changeset 262017 in webkit
- Timestamp:
- May 21, 2020 11:37:50 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r261987 r262017 1 2020-05-21 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Use @isUndefinedOrNull instead of abstract equality with null 4 https://bugs.webkit.org/show_bug.cgi?id=210954 5 6 Reviewed by Yusuke Suzuki. 7 8 * test262/expectations.yaml: Mark 16 test cases as passing. 9 1 10 2020-05-21 Alexey Shvayka <shvaikalesh@gmail.com> 2 11 -
trunk/JSTests/test262/expectations.yaml
r261987 r262017 1 1 --- 2 test/annexB/built-ins/Array/from/iterator-method-emulates-undefined.js:3 default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all'4 strict mode: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all'5 2 test/annexB/built-ins/Function/createdynfn-html-close-comment-params.js: 6 3 default: "SyntaxError: Unexpected token '}'. Expected a parameter pattern or a ')' in parameter list." … … 12 9 default: 'Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all' 13 10 strict mode: 'Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all' 14 test/annexB/built-ins/String/prototype/match/custom-matcher-emulates-undefined.js:15 default: 'Test262Error: Expected SameValue(«0», «1») to be true'16 strict mode: 'Test262Error: Expected SameValue(«0», «1») to be true'17 test/annexB/built-ins/String/prototype/replace/custom-replacer-emulates-undefined.js:18 default: 'Test262Error: Expected SameValue(«», «null») to be true'19 strict mode: 'Test262Error: Expected SameValue(«», «null») to be true'20 11 test/annexB/built-ins/String/prototype/replaceAll/custom-replacer-emulates-undefined.js: 21 12 default: 'Test262Error: Expected SameValue(«», «null») to be true' 22 13 strict mode: 'Test262Error: Expected SameValue(«», «null») to be true' 23 test/annexB/built-ins/String/prototype/search/custom-searcher-emulates-undefined.js:24 default: 'Test262Error: Expected SameValue(«-1», «null») to be true'25 strict mode: 'Test262Error: Expected SameValue(«-1», «null») to be true'26 test/annexB/built-ins/String/prototype/split/custom-splitter-emulates-undefined.js:27 default: 'Test262Error: Expected SameValue(«», «null») to be true'28 strict mode: 'Test262Error: Expected SameValue(«», «null») to be true'29 test/annexB/built-ins/TypedArrayConstructors/from/iterator-method-emulates-undefined.js:30 default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all (Testing with Float64Array.)'31 strict mode: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all (Testing with Float64Array.)'32 14 test/annexB/language/eval-code/direct/func-block-decl-eval-func-skip-early-err-block.js: 33 15 default: 'Test262Error: An initialized binding is not created prior to evaluation Expected a ReferenceError to be thrown but no exception was thrown at all' … … 1523 1505 default: 'SyntaxError: Invalid regular expression: number too large in {} quantifier' 1524 1506 strict mode: 'SyntaxError: Invalid regular expression: number too large in {} quantifier' 1525 test/built-ins/String/prototype/replace/cstm-replace-is-null.js:1526 default: 'TypeError: null is not a function'1527 strict mode: 'TypeError: null is not a function'1528 test/built-ins/String/prototype/replaceAll/searchValue-replacer-is-null.js:1529 default: 'TypeError: null is not a function'1530 strict mode: 'TypeError: null is not a function'1531 1507 test/built-ins/ThrowTypeError/extensible.js: 1532 1508 default: 'Test262Error: Expected SameValue(«true», «false») to be true' -
trunk/Source/JavaScriptCore/ChangeLog
r262014 r262017 1 2020-05-21 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Use @isUndefinedOrNull instead of abstract equality with null 4 https://bugs.webkit.org/show_bug.cgi?id=210954 5 6 Reviewed by Yusuke Suzuki. 7 8 This patch: 9 10 a) Replaces 2 `!== @undefined` comparisons in String.prototype.{replace,replaceAll} 11 with @isUndefinedOrNull() as per spec [1], aligning JSC with V8 and SpiderMonkey. 12 13 b) Replaces 3 `!= @undefined` and 7 `!= null` comparisons with @isUndefinedOrNull() 14 as only the latter is correct with [[IsHTMLDDA]] aka MasqueradesAsUndefined objects [2]. 15 16 c) Removes @isDictionary() since it is unused, easy to inline and its name is quite 17 misleading: one might expect it to perform Structure::isDictionary(). 18 19 [1]: https://tc39.es/ecma262/#sec-getmethod (step 3) 20 [2]: https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot 21 22 * builtins/ArrayConstructor.js: 23 * builtins/GlobalOperations.js: 24 (globalPrivate.isDictionary): Deleted. 25 * builtins/RegExpPrototype.js: 26 (Symbol.split): Unobservable as there is `=== null` check in @regExpExec. 27 * builtins/StringPrototype.js: 28 (match): 29 (replace): 30 (replaceAll): 31 (search): 32 (split): 33 * builtins/TypedArrayConstructor.js: 34 1 35 2020-05-21 Saam Barati <sbarati@apple.com> 2 36 -
trunk/Source/JavaScriptCore/builtins/ArrayConstructor.js
r261987 r262017 54 54 55 55 var iteratorMethod = items.@@iterator; 56 if ( iteratorMethod != null) {56 if (!@isUndefinedOrNull(iteratorMethod)) { 57 57 if (typeof iteratorMethod !== "function") 58 58 @throwTypeError("Array.from requires that the property of the first argument, items[Symbol.iterator], when exists, be a function"); -
trunk/Source/JavaScriptCore/builtins/GlobalOperations.js
r257681 r262017 48 48 // originally Math.min(Math.max(length, 0), maxSafeInteger)); 49 49 return +(length > 0 ? (length < @MAX_SAFE_INTEGER ? length : @MAX_SAFE_INTEGER) : 0); 50 }51 52 @globalPrivate53 function isDictionary(object)54 {55 "use strict";56 57 return object == null || typeof object === "object";58 50 } 59 51 -
trunk/Source/JavaScriptCore/builtins/RegExpPrototype.js
r260312 r262017 530 530 var z = @regExpExec(splitter, str); 531 531 // b. If z is not null, return A. 532 if (z != null)532 if (z !== null) 533 533 return result; 534 534 // c. Perform ! CreateDataProperty(A, "0", S). -
trunk/Source/JavaScriptCore/builtins/StringPrototype.js
r259029 r262017 33 33 @throwTypeError("String.prototype.match requires that |this| not be null or undefined"); 34 34 35 if ( regexp != null) {35 if (!@isUndefinedOrNull(regexp)) { 36 36 var matcher = regexp.@@match; 37 if ( matcher != @undefined)37 if (!@isUndefinedOrNull(matcher)) 38 38 return matcher.@call(regexp, this); 39 39 } … … 246 246 @throwTypeError("String.prototype.replace requires that |this| not be null or undefined"); 247 247 248 if ( search != null) {248 if (!@isUndefinedOrNull(search)) { 249 249 var replacer = search.@@replace; 250 if ( replacer !== @undefined) {250 if (!@isUndefinedOrNull(replacer)) { 251 251 if (!@hasObservableSideEffectsForStringReplace(search, replacer)) 252 252 return @toString(this).@replaceUsingRegExp(search, replace); … … 267 267 @throwTypeError("String.prototype.replaceAll requires |this| not to be null nor undefined"); 268 268 269 if ( search != null) {269 if (!@isUndefinedOrNull(search)) { 270 270 if (@isRegExp(search) && !@stringIncludesInternal.@call(@toString(search.flags), "g")) 271 271 @throwTypeError("String.prototype.replaceAll argument must not be a non-global regular expression"); 272 272 273 273 var replacer = search.@@replace; 274 if ( replacer !== @undefined) {274 if (!@isUndefinedOrNull(replacer)) { 275 275 if (!@hasObservableSideEffectsForStringReplace(search, replacer)) 276 276 return @toString(this).@replaceUsingRegExp(search, replace); … … 291 291 @throwTypeError("String.prototype.search requires that |this| not be null or undefined"); 292 292 293 if ( regexp != null) {293 if (!@isUndefinedOrNull(regexp)) { 294 294 var searcher = regexp.@@search; 295 if ( searcher != @undefined)295 if (!@isUndefinedOrNull(searcher)) 296 296 return searcher.@call(regexp, this); 297 297 } … … 309 309 @throwTypeError("String.prototype.split requires that |this| not be null or undefined"); 310 310 311 if ( separator != null) {311 if (!@isUndefinedOrNull(separator)) { 312 312 var splitter = separator.@@split; 313 if ( splitter != @undefined)313 if (!@isUndefinedOrNull(splitter)) 314 314 return splitter.@call(separator, this, limit); 315 315 } -
trunk/Source/JavaScriptCore/builtins/TypedArrayConstructor.js
r257681 r262017 63 63 64 64 var iteratorMethod = items.@@iterator; 65 if ( iteratorMethod != null) {65 if (!@isUndefinedOrNull(iteratorMethod)) { 66 66 if (typeof iteratorMethod !== "function") 67 67 @throwTypeError("TypedArray.from requires that the property of the first argument, items[Symbol.iterator], when exists, be a function");
Note: See TracChangeset
for help on using the changeset viewer.