| 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 var $mapEntries; | |
| 6 var $mapIteratorNext; | |
| 7 var $setIteratorNext; | |
| 8 var $setValues; | |
| 9 | |
| 10 (function(global, utils) { | 5 (function(global, utils) { |
| 11 | 6 |
| 12 "use strict"; | 7 "use strict"; |
| 13 | 8 |
| 14 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 15 | 10 |
| 16 var GlobalMap = global.Map; | 11 var GlobalMap = global.Map; |
| 17 var GlobalSet = global.Set; | 12 var GlobalSet = global.Set; |
| 18 var iteratorSymbol = utils.ImportNow("iterator_symbol"); | 13 var iteratorSymbol = utils.ImportNow("iterator_symbol"); |
| 19 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); | 14 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 "Set Iterator", READ_ONLY | DONT_ENUM); | 75 "Set Iterator", READ_ONLY | DONT_ENUM); |
| 81 | 76 |
| 82 utils.InstallFunctions(GlobalSet.prototype, DONT_ENUM, [ | 77 utils.InstallFunctions(GlobalSet.prototype, DONT_ENUM, [ |
| 83 'entries', SetEntries, | 78 'entries', SetEntries, |
| 84 'keys', SetValues, | 79 'keys', SetValues, |
| 85 'values', SetValues | 80 'values', SetValues |
| 86 ]); | 81 ]); |
| 87 | 82 |
| 88 %AddNamedProperty(GlobalSet.prototype, iteratorSymbol, SetValues, DONT_ENUM); | 83 %AddNamedProperty(GlobalSet.prototype, iteratorSymbol, SetValues, DONT_ENUM); |
| 89 | 84 |
| 90 $setIteratorNext = SetIteratorNextJS; | |
| 91 $setValues = SetValues; | |
| 92 | |
| 93 // ------------------------------------------------------------------- | 85 // ------------------------------------------------------------------- |
| 94 | 86 |
| 95 function MapIteratorConstructor(map, kind) { | 87 function MapIteratorConstructor(map, kind) { |
| 96 %MapIteratorInitialize(this, map, kind); | 88 %MapIteratorInitialize(this, map, kind); |
| 97 } | 89 } |
| 98 | 90 |
| 99 | 91 |
| 100 function MapIteratorNextJS() { | 92 function MapIteratorNextJS() { |
| 101 if (!IS_MAP_ITERATOR(this)) { | 93 if (!IS_MAP_ITERATOR(this)) { |
| 102 throw MakeTypeError(kIncompatibleMethodReceiver, | 94 throw MakeTypeError(kIncompatibleMethodReceiver, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 155 |
| 164 | 156 |
| 165 utils.InstallFunctions(GlobalMap.prototype, DONT_ENUM, [ | 157 utils.InstallFunctions(GlobalMap.prototype, DONT_ENUM, [ |
| 166 'entries', MapEntries, | 158 'entries', MapEntries, |
| 167 'keys', MapKeys, | 159 'keys', MapKeys, |
| 168 'values', MapValues | 160 'values', MapValues |
| 169 ]); | 161 ]); |
| 170 | 162 |
| 171 %AddNamedProperty(GlobalMap.prototype, iteratorSymbol, MapEntries, DONT_ENUM); | 163 %AddNamedProperty(GlobalMap.prototype, iteratorSymbol, MapEntries, DONT_ENUM); |
| 172 | 164 |
| 173 $mapEntries = MapEntries; | 165 // ------------------------------------------------------------------- |
| 174 $mapIteratorNext = MapIteratorNextJS; | 166 // Exports |
| 167 |
| 168 utils.Export(function(to) { |
| 169 to.MapEntries = MapEntries; |
| 170 to.MapIteratorNext = MapIteratorNextJS; |
| 171 to.SetIteratorNext = SetIteratorNextJS; |
| 172 to.SetValues = SetValues; |
| 173 }); |
| 175 | 174 |
| 176 }) | 175 }) |
| OLD | NEW |