OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 %SetNativeFlag(Intl.NumberFormat.supportedLocalesOf); | 1295 %SetNativeFlag(Intl.NumberFormat.supportedLocalesOf); |
1296 | 1296 |
1297 | 1297 |
1298 /** | 1298 /** |
1299 * Returns a String value representing the result of calling ToNumber(value) | 1299 * Returns a String value representing the result of calling ToNumber(value) |
1300 * according to the effective locale and the formatting options of this | 1300 * according to the effective locale and the formatting options of this |
1301 * NumberFormat. | 1301 * NumberFormat. |
1302 */ | 1302 */ |
1303 function formatNumber(formatter, value) { | 1303 function formatNumber(formatter, value) { |
1304 // Spec treats -0 and +0 as 0. | 1304 // Spec treats -0 and +0 as 0. |
1305 var number = $Number(value); | 1305 var number = $Number(value) + 0; |
1306 if (number === -0) { | |
1307 number = 0; | |
1308 } | |
1309 | 1306 |
1310 return %InternalNumberFormat(formatter.formatter, number); | 1307 return %InternalNumberFormat(formatter.formatter, number); |
1311 } | 1308 } |
1312 | 1309 |
1313 | 1310 |
1314 /** | 1311 /** |
1315 * Returns a Number that represents string value that was passed in. | 1312 * Returns a Number that represents string value that was passed in. |
1316 */ | 1313 */ |
1317 function parseNumber(formatter, value) { | 1314 function parseNumber(formatter, value) { |
1318 return %InternalNumberParse(formatter.formatter, $String(value)); | 1315 return %InternalNumberParse(formatter.formatter, $String(value)); |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 writable: true, | 2104 writable: true, |
2108 configurable: true, | 2105 configurable: true, |
2109 enumerable: false | 2106 enumerable: false |
2110 }); | 2107 }); |
2111 %FunctionSetName($Date.prototype.toLocaleTimeString, 'toLocaleTimeString'); | 2108 %FunctionSetName($Date.prototype.toLocaleTimeString, 'toLocaleTimeString'); |
2112 %FunctionRemovePrototype($Date.prototype.toLocaleTimeString); | 2109 %FunctionRemovePrototype($Date.prototype.toLocaleTimeString); |
2113 %SetNativeFlag($Date.prototype.toLocaleTimeString); | 2110 %SetNativeFlag($Date.prototype.toLocaleTimeString); |
2114 | 2111 |
2115 return Intl; | 2112 return Intl; |
2116 }())}); | 2113 }())}); |
OLD | NEW |