Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: src/v8natives.js

Issue 1096243003: Migrate error messages, part 5 (array.js and i18n.js). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/uri.js ('k') | test/mjsunit/messages.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file relies on the fact that the following declarations have been made 5 // This file relies on the fact that the following declarations have been made
6 // in runtime.js: 6 // in runtime.js:
7 // var $Object = global.Object; 7 // var $Object = global.Object;
8 // var $Boolean = global.Boolean; 8 // var $Boolean = global.Boolean;
9 // var $Number = global.Number; 9 // var $Number = global.Number;
10 // var $Function = global.Function; 10 // var $Function = global.Function;
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 // Get the value of this number in case it's an object. 1531 // Get the value of this number in case it's an object.
1532 number = %_ValueOf(this); 1532 number = %_ValueOf(this);
1533 } 1533 }
1534 // Fast case: Convert number in radix 10. 1534 // Fast case: Convert number in radix 10.
1535 if (IS_UNDEFINED(radix) || radix === 10) { 1535 if (IS_UNDEFINED(radix) || radix === 10) {
1536 return %_NumberToString(number); 1536 return %_NumberToString(number);
1537 } 1537 }
1538 1538
1539 // Convert the radix to an integer and check the range. 1539 // Convert the radix to an integer and check the range.
1540 radix = TO_INTEGER(radix); 1540 radix = TO_INTEGER(radix);
1541 if (radix < 2 || radix > 36) { 1541 if (radix < 2 || radix > 36) throw MakeRangeError(kToRadixFormatRange);
1542 throw new $RangeError('toString() radix argument must be between 2 and 36');
1543 }
1544 // Convert the number to a string in the given radix. 1542 // Convert the number to a string in the given radix.
1545 return %NumberToRadixString(number, radix); 1543 return %NumberToRadixString(number, radix);
1546 } 1544 }
1547 1545
1548 1546
1549 // ECMA-262 section 15.7.4.3 1547 // ECMA-262 section 15.7.4.3
1550 function NumberToLocaleString() { 1548 function NumberToLocaleString() {
1551 return %_CallFunction(this, NumberToStringJS); 1549 return %_CallFunction(this, NumberToStringJS);
1552 } 1550 }
1553 1551
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 } 1892 }
1895 if (!IS_SPEC_FUNCTION(method)) { 1893 if (!IS_SPEC_FUNCTION(method)) {
1896 throw MakeTypeError(kNotIterable, obj); 1894 throw MakeTypeError(kNotIterable, obj);
1897 } 1895 }
1898 var iterator = %_CallFunction(obj, method); 1896 var iterator = %_CallFunction(obj, method);
1899 if (!IS_SPEC_OBJECT(iterator)) { 1897 if (!IS_SPEC_OBJECT(iterator)) {
1900 throw MakeTypeError(kNotAnIterator, iterator); 1898 throw MakeTypeError(kNotAnIterator, iterator);
1901 } 1899 }
1902 return iterator; 1900 return iterator;
1903 } 1901 }
OLDNEW
« no previous file with comments | « src/uri.js ('k') | test/mjsunit/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698