OLD | NEW |
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 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 %CheckIsBootstrapping(); | 7 %CheckIsBootstrapping(); |
8 | 8 |
9 // ---------------------------------------------------------------------------- | 9 // ---------------------------------------------------------------------------- |
10 // Imports | 10 // Imports |
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 "seal", ObjectSealJS | 1334 "seal", ObjectSealJS |
1335 // deliverChangeRecords, getNotifier, observe and unobserve are added | 1335 // deliverChangeRecords, getNotifier, observe and unobserve are added |
1336 // in object-observe.js. | 1336 // in object-observe.js. |
1337 ]); | 1337 ]); |
1338 | 1338 |
1339 | 1339 |
1340 // ---------------------------------------------------------------------------- | 1340 // ---------------------------------------------------------------------------- |
1341 // Boolean | 1341 // Boolean |
1342 | 1342 |
1343 function BooleanConstructor(x) { | 1343 function BooleanConstructor(x) { |
| 1344 // TODO(bmeurer): Move this to toplevel. |
| 1345 "use strict"; |
1344 if (%_IsConstructCall()) { | 1346 if (%_IsConstructCall()) { |
1345 %_SetValueOf(this, ToBoolean(x)); | 1347 %_SetValueOf(this, ToBoolean(x)); |
1346 } else { | 1348 } else { |
1347 return ToBoolean(x); | 1349 return ToBoolean(x); |
1348 } | 1350 } |
1349 } | 1351 } |
1350 | 1352 |
1351 | 1353 |
1352 function BooleanToString() { | 1354 function BooleanToString() { |
1353 // NOTE: Both Boolean objects and values can enter here as | 1355 // NOTE: Both Boolean objects and values can enter here as |
(...skipping 29 matching lines...) Expand all Loading... |
1383 utils.InstallFunctions(GlobalBoolean.prototype, DONT_ENUM, [ | 1385 utils.InstallFunctions(GlobalBoolean.prototype, DONT_ENUM, [ |
1384 "toString", BooleanToString, | 1386 "toString", BooleanToString, |
1385 "valueOf", BooleanValueOf | 1387 "valueOf", BooleanValueOf |
1386 ]); | 1388 ]); |
1387 | 1389 |
1388 | 1390 |
1389 // ---------------------------------------------------------------------------- | 1391 // ---------------------------------------------------------------------------- |
1390 // Number | 1392 // Number |
1391 | 1393 |
1392 function NumberConstructor(x) { | 1394 function NumberConstructor(x) { |
| 1395 // TODO(bmeurer): Move this to toplevel. |
| 1396 "use strict"; |
1393 var value = %_ArgumentsLength() == 0 ? 0 : ToNumber(x); | 1397 var value = %_ArgumentsLength() == 0 ? 0 : ToNumber(x); |
1394 if (%_IsConstructCall()) { | 1398 if (%_IsConstructCall()) { |
1395 %_SetValueOf(this, value); | 1399 %_SetValueOf(this, value); |
1396 } else { | 1400 } else { |
1397 return value; | 1401 return value; |
1398 } | 1402 } |
1399 } | 1403 } |
1400 | 1404 |
1401 | 1405 |
1402 // ECMA-262 section 15.7.4.2. | 1406 // ECMA-262 section 15.7.4.2. |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1809 }); | 1813 }); |
1810 | 1814 |
1811 %InstallToContext([ | 1815 %InstallToContext([ |
1812 "global_eval_fun", GlobalEval, | 1816 "global_eval_fun", GlobalEval, |
1813 "object_define_own_property", DefineOwnPropertyFromAPI, | 1817 "object_define_own_property", DefineOwnPropertyFromAPI, |
1814 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, | 1818 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, |
1815 "to_complete_property_descriptor", ToCompletePropertyDescriptor, | 1819 "to_complete_property_descriptor", ToCompletePropertyDescriptor, |
1816 ]); | 1820 ]); |
1817 | 1821 |
1818 }) | 1822 }) |
OLD | NEW |