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

Side by Side Diff: src/v8natives.js

Issue 1347663002: [es6] Move builtin constructors for primitives to strict mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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
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 (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
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 "use strict";
Michael Starzinger 2015/09/15 13:09:59 nit: TODO here as well.
1344 if (%_IsConstructCall()) { 1345 if (%_IsConstructCall()) {
1345 %_SetValueOf(this, ToBoolean(x)); 1346 %_SetValueOf(this, ToBoolean(x));
1346 } else { 1347 } else {
1347 return ToBoolean(x); 1348 return ToBoolean(x);
1348 } 1349 }
1349 } 1350 }
1350 1351
1351 1352
1352 function BooleanToString() { 1353 function BooleanToString() {
1353 // NOTE: Both Boolean objects and values can enter here as 1354 // NOTE: Both Boolean objects and values can enter here as
(...skipping 29 matching lines...) Expand all
1383 utils.InstallFunctions(GlobalBoolean.prototype, DONT_ENUM, [ 1384 utils.InstallFunctions(GlobalBoolean.prototype, DONT_ENUM, [
1384 "toString", BooleanToString, 1385 "toString", BooleanToString,
1385 "valueOf", BooleanValueOf 1386 "valueOf", BooleanValueOf
1386 ]); 1387 ]);
1387 1388
1388 1389
1389 // ---------------------------------------------------------------------------- 1390 // ----------------------------------------------------------------------------
1390 // Number 1391 // Number
1391 1392
1392 function NumberConstructor(x) { 1393 function NumberConstructor(x) {
1394 "use strict";
Michael Starzinger 2015/09/15 13:09:59 nit: Likwise.
1393 var value = %_ArgumentsLength() == 0 ? 0 : ToNumber(x); 1395 var value = %_ArgumentsLength() == 0 ? 0 : ToNumber(x);
1394 if (%_IsConstructCall()) { 1396 if (%_IsConstructCall()) {
1395 %_SetValueOf(this, value); 1397 %_SetValueOf(this, value);
1396 } else { 1398 } else {
1397 return value; 1399 return value;
1398 } 1400 }
1399 } 1401 }
1400 1402
1401 1403
1402 // ECMA-262 section 15.7.4.2. 1404 // ECMA-262 section 15.7.4.2.
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 }); 1811 });
1810 1812
1811 %InstallToContext([ 1813 %InstallToContext([
1812 "global_eval_fun", GlobalEval, 1814 "global_eval_fun", GlobalEval,
1813 "object_define_own_property", DefineOwnPropertyFromAPI, 1815 "object_define_own_property", DefineOwnPropertyFromAPI,
1814 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, 1816 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor,
1815 "to_complete_property_descriptor", ToCompletePropertyDescriptor, 1817 "to_complete_property_descriptor", ToCompletePropertyDescriptor,
1816 ]); 1818 ]);
1817 1819
1818 }) 1820 })
OLDNEW
« src/symbol.js ('K') | « src/symbol.js ('k') | test/mjsunit/regress/regress-105.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698