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

Side by Side Diff: src/harmony-tostring.js

Issue 1072083002: [es6] don't "replace" Object.prototype.toString for --harmony-tostring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Final fixup... 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/bootstrapper.cc ('k') | src/heap/heap.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 "use strict"; 5 "use strict";
6 6
7 // This file relies on the fact that the following declaration has been made 7 // This file relies on the fact that the following declaration has been made
8 // in runtime.js and symbol.js: 8 // in runtime.js and symbol.js:
9 // var $Object = global.Object; 9 // var $Object = global.Object;
10 10
(...skipping 14 matching lines...) Expand all
25 function HarmonyToStringExtendSymbolPrototype() { 25 function HarmonyToStringExtendSymbolPrototype() {
26 %CheckIsBootstrapping(); 26 %CheckIsBootstrapping();
27 27
28 InstallConstants(global.Symbol, $Array( 28 InstallConstants(global.Symbol, $Array(
29 // TODO(dslomov, caitp): Move to symbol.js when shipping 29 // TODO(dslomov, caitp): Move to symbol.js when shipping
30 "toStringTag", symbolToStringTag 30 "toStringTag", symbolToStringTag
31 )); 31 ));
32 } 32 }
33 33
34 HarmonyToStringExtendSymbolPrototype(); 34 HarmonyToStringExtendSymbolPrototype();
35
36 function HarmonyToStringExtendObjectPrototype() {
37 %CheckIsBootstrapping();
38
39 // Can't use InstallFunctions() because will fail in Debug mode.
40 // Emulate InstallFunctions() here.
41 %FunctionSetName(ObjectToStringHarmony, "toString");
42 %FunctionRemovePrototype(ObjectToStringHarmony);
43 %SetNativeFlag(ObjectToStringHarmony);
44
45 // Set up the non-enumerable functions on the Array prototype object.
46 var desc = ToPropertyDescriptor({
47 value: ObjectToStringHarmony
48 });
49 DefineOwnProperty($Object.prototype, "toString", desc, false);
50
51 %ToFastProperties($Object.prototype);
52 }
53
54 HarmonyToStringExtendObjectPrototype();
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698