OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 | 7 |
8 // This file relies on the fact that the following declaration has been made | 8 // This file relies on the fact that the following declaration has been made |
9 // in runtime.js: | 9 // in runtime.js: |
10 // var $Set = global.Set; | 10 // var $Set = global.Set; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 %SetCode(SetIterator, SetIteratorConstructor); | 70 %SetCode(SetIterator, SetIteratorConstructor); |
71 %FunctionSetPrototype(SetIterator, new $Object()); | 71 %FunctionSetPrototype(SetIterator, new $Object()); |
72 %FunctionSetInstanceClassName(SetIterator, 'Set Iterator'); | 72 %FunctionSetInstanceClassName(SetIterator, 'Set Iterator'); |
73 InstallFunctions(SetIterator.prototype, DONT_ENUM, $Array( | 73 InstallFunctions(SetIterator.prototype, DONT_ENUM, $Array( |
74 'next', SetIteratorNextJS | 74 'next', SetIteratorNextJS |
75 )); | 75 )); |
76 | 76 |
77 %FunctionSetName(SetIteratorSymbolIterator, '[Symbol.iterator]'); | 77 %FunctionSetName(SetIteratorSymbolIterator, '[Symbol.iterator]'); |
78 %AddNamedProperty(SetIterator.prototype, symbolIterator, | 78 %AddNamedProperty(SetIterator.prototype, symbolIterator, |
79 SetIteratorSymbolIterator, DONT_ENUM); | 79 SetIteratorSymbolIterator, DONT_ENUM); |
| 80 %AddNamedProperty(SetIterator.prototype, symbolToStringTag, |
| 81 "Set Iterator", READ_ONLY | DONT_ENUM); |
80 } | 82 } |
81 | 83 |
82 SetUpSetIterator(); | 84 SetUpSetIterator(); |
83 | 85 |
84 | 86 |
85 function ExtendSetPrototype() { | 87 function ExtendSetPrototype() { |
86 %CheckIsBootstrapping(); | 88 %CheckIsBootstrapping(); |
87 | 89 |
88 InstallFunctions($Set.prototype, DONT_ENUM, $Array( | 90 InstallFunctions($Set.prototype, DONT_ENUM, $Array( |
89 'entries', SetEntries, | 91 'entries', SetEntries, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 %SetCode(MapIterator, MapIteratorConstructor); | 169 %SetCode(MapIterator, MapIteratorConstructor); |
168 %FunctionSetPrototype(MapIterator, new $Object()); | 170 %FunctionSetPrototype(MapIterator, new $Object()); |
169 %FunctionSetInstanceClassName(MapIterator, 'Map Iterator'); | 171 %FunctionSetInstanceClassName(MapIterator, 'Map Iterator'); |
170 InstallFunctions(MapIterator.prototype, DONT_ENUM, $Array( | 172 InstallFunctions(MapIterator.prototype, DONT_ENUM, $Array( |
171 'next', MapIteratorNextJS | 173 'next', MapIteratorNextJS |
172 )); | 174 )); |
173 | 175 |
174 %FunctionSetName(MapIteratorSymbolIterator, '[Symbol.iterator]'); | 176 %FunctionSetName(MapIteratorSymbolIterator, '[Symbol.iterator]'); |
175 %AddNamedProperty(MapIterator.prototype, symbolIterator, | 177 %AddNamedProperty(MapIterator.prototype, symbolIterator, |
176 MapIteratorSymbolIterator, DONT_ENUM); | 178 MapIteratorSymbolIterator, DONT_ENUM); |
| 179 %AddNamedProperty(MapIterator.prototype, symbolToStringTag, |
| 180 "Map Iterator", READ_ONLY | DONT_ENUM); |
177 } | 181 } |
178 | 182 |
179 SetUpMapIterator(); | 183 SetUpMapIterator(); |
180 | 184 |
181 | 185 |
182 function ExtendMapPrototype() { | 186 function ExtendMapPrototype() { |
183 %CheckIsBootstrapping(); | 187 %CheckIsBootstrapping(); |
184 | 188 |
185 InstallFunctions($Map.prototype, DONT_ENUM, $Array( | 189 InstallFunctions($Map.prototype, DONT_ENUM, $Array( |
186 'entries', MapEntries, | 190 'entries', MapEntries, |
187 'keys', MapKeys, | 191 'keys', MapKeys, |
188 'values', MapValues | 192 'values', MapValues |
189 )); | 193 )); |
190 | 194 |
191 %AddNamedProperty($Map.prototype, symbolIterator, MapEntries, DONT_ENUM); | 195 %AddNamedProperty($Map.prototype, symbolIterator, MapEntries, DONT_ENUM); |
192 } | 196 } |
193 | 197 |
194 ExtendMapPrototype(); | 198 ExtendMapPrototype(); |
OLD | NEW |