Changeset 184871 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- May 26, 2015, 2:17:22 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r184868 r184871 1 2015-05-26 Yusuke Suzuki <[email protected]> 2 3 Reflect nits for r184863 4 https://bugs.webkit.org/show_bug.cgi?id=145107 5 6 Reviewed by Darin Adler. 7 8 1. Added the copyright line. 9 2. Added an optional argument (/*, end */). To do so, fixed generate-js-builtins. 10 3. Dropped the unnecessary variable `thisValue`. 11 4. Fix the type error messages. This is also found in StringIterator.prototype.js. 12 5. Added tests for 0 arguments. 13 14 * builtins/Array.prototype.js: 15 (copyWithin): 16 * builtins/StringIterator.prototype.js: 17 (next): 18 * generate-js-builtins: 19 * tests/stress/array-copywithin.js: 20 * tests/stress/string-iterators.js: 21 1 22 2015-05-26 Yusuke Suzuki <[email protected]> 2 23 -
trunk/Source/JavaScriptCore/builtins/Array.prototype.js
r184863 r184871 1 1 /* 2 2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. 3 * Copyright (C) 2015 Yusuke Suzuki <[email protected]>. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 457 458 } 458 459 459 function copyWithin(target, start )460 function copyWithin(target, start /*, end */) 460 461 { 461 462 "use strict"; … … 471 472 } 472 473 473 var thisValue = this; 474 if (thisValue === null || thisValue === undefined) 475 throw new @TypeError("Array.copyWithin requires that |this| be not null or undefined"); 476 var thisObject = @Object(thisValue); 474 if (this === null || this === undefined) 475 throw new @TypeError("Array.copyWithin requires that |this| not be null or undefined"); 476 var thisObject = @Object(this); 477 477 478 478 var length = @ToLength(thisObject.length); -
trunk/Source/JavaScriptCore/builtins/StringIterator.prototype.js
r182118 r184871 28 28 29 29 if (this == null) 30 throw new @TypeError("%StringIteratorPrototype%.next requires that |this| be notnull or undefined");30 throw new @TypeError("%StringIteratorPrototype%.next requires that |this| not be null or undefined"); 31 31 32 32 var position = this.@stringIteratorNextIndex; -
trunk/Source/JavaScriptCore/generate-js-builtins
r183738 r184871 67 67 functionHeadRegExp = re.compile(r"function\s+\w+\s*\(.*?\)", re.MULTILINE | re.S) 68 68 functionNameRegExp = re.compile(r"function\s+(\w+)\s*\(", re.MULTILINE | re.S) 69 functionParameterFinder = re.compile(r"^function\s+(?:\w+)\s*\(((?:\s*\w+)?\s*(?:\s*,\s*\w+)*)?\ )", re.MULTILINE | re.S)69 functionParameterFinder = re.compile(r"^function\s+(?:\w+)\s*\(((?:\s*\w+)?\s*(?:\s*,\s*\w+)*)?\s*\)", re.MULTILINE | re.S) 70 70 71 71 multilineCommentRegExp = re.compile(r"\/\*.*?\*\/", re.MULTILINE | re.S) -
trunk/Source/JavaScriptCore/tests/stress/array-copywithin.js
r184863 r184871 35 35 shouldBe(Array.prototype.hasOwnProperty('copyWithin'), true); 36 36 shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(Array.prototype, 'copyWithin')), '{"writable":true,"enumerable":false,"configurable":true}'); 37 38 // 0 arguments. (it is equivalent to copyWithin(0)) 39 shouldBeArray([1, 2, 3, 4, 5].copyWithin(), [1, 2, 3, 4, 5]); 40 shouldBeArray([].copyWithin(), []); 37 41 38 42 // 1 arguments. … … 235 239 shouldThrow(function () { 236 240 Array.prototype.copyWithin.call(undefined); 237 }, 'TypeError: Array.copyWithin requires that |this| be notnull or undefined');241 }, 'TypeError: Array.copyWithin requires that |this| not be null or undefined'); 238 242 239 243 shouldThrow(function () { 240 244 Array.prototype.copyWithin.call(null); 241 }, 'TypeError: Array.copyWithin requires that |this| be notnull or undefined');245 }, 'TypeError: Array.copyWithin requires that |this| not be null or undefined'); 242 246 243 247 -
trunk/Source/JavaScriptCore/tests/stress/string-iterators.js
r182118 r184871 183 183 var message = 'TypeError: %StringIteratorPrototype%.next requires that |this| be a String Iterator instance'; 184 184 if (primitive == null) 185 message = 'TypeError: %StringIteratorPrototype%.next requires that |this| be notnull or undefined'185 message = 'TypeError: %StringIteratorPrototype%.next requires that |this| not be null or undefined' 186 186 if (String(didThrow) !== message) 187 187 throw "Error: bad error thrown: " + didThrow;
Note:
See TracChangeset
for help on using the changeset viewer.