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

Side by Side Diff: src/symbol.js

Issue 1310163004: [runtime] Use utils.InstallFunctions for Symbol.prototype[@@toPrimitive]. (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
« no previous file with comments | « no previous file | no next file » | 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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 "unscopables", unscopablesSymbol, 112 "unscopables", unscopablesSymbol,
113 ]); 113 ]);
114 114
115 utils.InstallFunctions(GlobalSymbol, DONT_ENUM, [ 115 utils.InstallFunctions(GlobalSymbol, DONT_ENUM, [
116 "for", SymbolFor, 116 "for", SymbolFor,
117 "keyFor", SymbolKeyFor 117 "keyFor", SymbolKeyFor
118 ]); 118 ]);
119 119
120 %AddNamedProperty( 120 %AddNamedProperty(
121 GlobalSymbol.prototype, "constructor", GlobalSymbol, DONT_ENUM); 121 GlobalSymbol.prototype, "constructor", GlobalSymbol, DONT_ENUM);
122 utils.SetFunctionName(SymbolToPrimitive, toPrimitiveSymbol);
123 %AddNamedProperty(
124 GlobalSymbol.prototype, toPrimitiveSymbol, SymbolToPrimitive,
125 DONT_ENUM | READ_ONLY);
126 %AddNamedProperty( 122 %AddNamedProperty(
127 GlobalSymbol.prototype, toStringTagSymbol, "Symbol", DONT_ENUM | READ_ONLY); 123 GlobalSymbol.prototype, toStringTagSymbol, "Symbol", DONT_ENUM | READ_ONLY);
128 124
125 utils.InstallFunctions(GlobalSymbol.prototype, DONT_ENUM | READ_ONLY, [
126 toPrimitiveSymbol, SymbolToPrimitive
127 ]);
128
129 utils.InstallFunctions(GlobalSymbol.prototype, DONT_ENUM, [ 129 utils.InstallFunctions(GlobalSymbol.prototype, DONT_ENUM, [
130 "toString", SymbolToString, 130 "toString", SymbolToString,
131 "valueOf", SymbolValueOf 131 "valueOf", SymbolValueOf
132 ]); 132 ]);
133 133
134 utils.InstallFunctions(GlobalObject, DONT_ENUM, [ 134 utils.InstallFunctions(GlobalObject, DONT_ENUM, [
135 "getOwnPropertySymbols", ObjectGetOwnPropertySymbols 135 "getOwnPropertySymbols", ObjectGetOwnPropertySymbols
136 ]); 136 ]);
137 137
138 // ------------------------------------------------------------------- 138 // -------------------------------------------------------------------
139 // Exports 139 // Exports
140 140
141 utils.Export(function(to) { 141 utils.Export(function(to) {
142 to.SymbolToString = SymbolToString; 142 to.SymbolToString = SymbolToString;
143 }) 143 })
144 144
145 }) 145 })
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698