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

Side by Side Diff: src/symbol.js

Issue 1127543003: Revert of Reland "Wrap v8natives.js into a function." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/string-iterator.js ('k') | src/third_party/fdlibm/fdlibm.js » ('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 // Expects following symbols to be set in the bootstrapper during genesis: 5 // Expects following symbols to be set in the bootstrapper during genesis:
6 // - symbolHasInstance 6 // - symbolHasInstance
7 // - symbolIsConcatSpreadable 7 // - symbolIsConcatSpreadable
8 // - symbolIsRegExp 8 // - symbolIsRegExp
9 // - symbolIterator 9 // - symbolIterator
10 // - symbolToStringTag 10 // - symbolToStringTag
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return %SymbolRegistry().keyFor[symbol]; 66 return %SymbolRegistry().keyFor[symbol];
67 } 67 }
68 68
69 69
70 // ES6 19.1.2.8 70 // ES6 19.1.2.8
71 function ObjectGetOwnPropertySymbols(obj) { 71 function ObjectGetOwnPropertySymbols(obj) {
72 obj = ToObject(obj); 72 obj = ToObject(obj);
73 73
74 // TODO(arv): Proxies use a shared trap for String and Symbol keys. 74 // TODO(arv): Proxies use a shared trap for String and Symbol keys.
75 75
76 return $objectGetOwnPropertyKeys(obj, PROPERTY_ATTRIBUTES_STRING); 76 return ObjectGetOwnPropertyKeys(obj, PROPERTY_ATTRIBUTES_STRING);
77 } 77 }
78 78
79 //------------------------------------------------------------------- 79 //-------------------------------------------------------------------
80 80
81 %SetCode(GlobalSymbol, SymbolConstructor); 81 %SetCode(GlobalSymbol, SymbolConstructor);
82 %FunctionSetPrototype(GlobalSymbol, new GlobalObject()); 82 %FunctionSetPrototype(GlobalSymbol, new GlobalObject());
83 83
84 $installConstants(GlobalSymbol, [ 84 InstallConstants(GlobalSymbol, [
85 // TODO(rossberg): expose when implemented. 85 // TODO(rossberg): expose when implemented.
86 // "hasInstance", symbolHasInstance, 86 // "hasInstance", symbolHasInstance,
87 // "isConcatSpreadable", symbolIsConcatSpreadable, 87 // "isConcatSpreadable", symbolIsConcatSpreadable,
88 // "isRegExp", symbolIsRegExp, 88 // "isRegExp", symbolIsRegExp,
89 "iterator", symbolIterator, 89 "iterator", symbolIterator,
90 // TODO(dslomov, caitp): Currently defined in harmony-tostring.js --- 90 // TODO(dslomov, caitp): Currently defined in harmony-tostring.js ---
91 // Move here when shipping 91 // Move here when shipping
92 // "toStringTag", symbolToStringTag, 92 // "toStringTag", symbolToStringTag,
93 "unscopables", symbolUnscopables 93 "unscopables", symbolUnscopables
94 ]); 94 ]);
95 95
96 $installFunctions(GlobalSymbol, DONT_ENUM, [ 96 InstallFunctions(GlobalSymbol, DONT_ENUM, [
97 "for", SymbolFor, 97 "for", SymbolFor,
98 "keyFor", SymbolKeyFor 98 "keyFor", SymbolKeyFor
99 ]); 99 ]);
100 100
101 %AddNamedProperty( 101 %AddNamedProperty(
102 GlobalSymbol.prototype, "constructor", GlobalSymbol, DONT_ENUM); 102 GlobalSymbol.prototype, "constructor", GlobalSymbol, DONT_ENUM);
103 %AddNamedProperty( 103 %AddNamedProperty(
104 GlobalSymbol.prototype, symbolToStringTag, "Symbol", DONT_ENUM | READ_ONLY); 104 GlobalSymbol.prototype, symbolToStringTag, "Symbol", DONT_ENUM | READ_ONLY);
105 105
106 $installFunctions(GlobalSymbol.prototype, DONT_ENUM, [ 106 InstallFunctions(GlobalSymbol.prototype, DONT_ENUM, [
107 "toString", SymbolToString, 107 "toString", SymbolToString,
108 "valueOf", SymbolValueOf 108 "valueOf", SymbolValueOf
109 ]); 109 ]);
110 110
111 $installFunctions(GlobalObject, DONT_ENUM, [ 111 InstallFunctions(GlobalObject, DONT_ENUM, [
112 "getOwnPropertySymbols", ObjectGetOwnPropertySymbols 112 "getOwnPropertySymbols", ObjectGetOwnPropertySymbols
113 ]); 113 ]);
114 114
115 $symbolToString = SymbolToString; 115 $symbolToString = SymbolToString;
116 116
117 })(); 117 })();
OLDNEW
« no previous file with comments | « src/string-iterator.js ('k') | src/third_party/fdlibm/fdlibm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698