OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 if (radix < 2 || radix > 36) { | 1406 if (radix < 2 || radix > 36) { |
1407 throw new $RangeError('toString() radix argument must be between 2 and 36'); | 1407 throw new $RangeError('toString() radix argument must be between 2 and 36'); |
1408 } | 1408 } |
1409 // Convert the number to a string in the given radix. | 1409 // Convert the number to a string in the given radix. |
1410 return %NumberToRadixString(number, radix); | 1410 return %NumberToRadixString(number, radix); |
1411 } | 1411 } |
1412 | 1412 |
1413 | 1413 |
1414 // ECMA-262 section 15.7.4.3 | 1414 // ECMA-262 section 15.7.4.3 |
1415 function NumberToLocaleString() { | 1415 function NumberToLocaleString() { |
1416 return NumberToString(); | 1416 return %_CallFunction(this, NumberToString); |
1417 } | 1417 } |
1418 | 1418 |
1419 | 1419 |
1420 // ECMA-262 section 15.7.4.4 | 1420 // ECMA-262 section 15.7.4.4 |
1421 function NumberValueOf() { | 1421 function NumberValueOf() { |
1422 // NOTE: Both Number objects and values can enter here as | 1422 // NOTE: Both Number objects and values can enter here as |
1423 // 'this'. This is not as dictated by ECMA-262. | 1423 // 'this'. This is not as dictated by ECMA-262. |
1424 if (!IS_NUMBER(this) && !IS_NUMBER_WRAPPER(this)) { | 1424 if (!IS_NUMBER(this) && !IS_NUMBER_WRAPPER(this)) { |
1425 throw new $TypeError('Number.prototype.valueOf is not generic'); | 1425 throw new $TypeError('Number.prototype.valueOf is not generic'); |
1426 } | 1426 } |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 | 1699 |
1700 function SetUpFunction() { | 1700 function SetUpFunction() { |
1701 %CheckIsBootstrapping(); | 1701 %CheckIsBootstrapping(); |
1702 InstallFunctions($Function.prototype, DONT_ENUM, $Array( | 1702 InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
1703 "bind", FunctionBind, | 1703 "bind", FunctionBind, |
1704 "toString", FunctionToString | 1704 "toString", FunctionToString |
1705 )); | 1705 )); |
1706 } | 1706 } |
1707 | 1707 |
1708 SetUpFunction(); | 1708 SetUpFunction(); |
OLD | NEW |