OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "use strict"; | 6 "use strict"; |
7 | 7 |
8 %CheckIsBootstrapping(); | 8 %CheckIsBootstrapping(); |
9 | 9 |
10 // ------------------------------------------------------------------- | 10 // ------------------------------------------------------------------- |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 function SetForEach(f, receiver) { | 241 function SetForEach(f, receiver) { |
242 if (!IS_SET(this)) { | 242 if (!IS_SET(this)) { |
243 throw MakeTypeError(kIncompatibleMethodReceiver, | 243 throw MakeTypeError(kIncompatibleMethodReceiver, |
244 'Set.prototype.forEach', this); | 244 'Set.prototype.forEach', this); |
245 } | 245 } |
246 | 246 |
247 if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f); | 247 if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f); |
248 | 248 |
249 var iterator = new SetIterator(this, ITERATOR_KIND_VALUES); | 249 var iterator = new SetIterator(this, ITERATOR_KIND_VALUES); |
250 var key; | 250 var key; |
| 251 var stepping = DEBUG_IS_STEPPING(f); |
251 var value_array = [UNDEFINED]; | 252 var value_array = [UNDEFINED]; |
252 while (%SetIteratorNext(iterator, value_array)) { | 253 while (%SetIteratorNext(iterator, value_array)) { |
| 254 if (stepping) %DebugPrepareStepInIfStepping(f); |
253 key = value_array[0]; | 255 key = value_array[0]; |
254 %_Call(f, receiver, key, key, this); | 256 %_Call(f, receiver, key, key, this); |
255 } | 257 } |
256 } | 258 } |
257 | 259 |
258 // ------------------------------------------------------------------- | 260 // ------------------------------------------------------------------- |
259 | 261 |
260 %SetCode(GlobalSet, SetConstructor); | 262 %SetCode(GlobalSet, SetConstructor); |
261 %FunctionSetLength(GlobalSet, 0); | 263 %FunctionSetLength(GlobalSet, 0); |
262 %FunctionSetPrototype(GlobalSet, new GlobalObject()); | 264 %FunctionSetPrototype(GlobalSet, new GlobalObject()); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 424 |
423 function MapForEach(f, receiver) { | 425 function MapForEach(f, receiver) { |
424 if (!IS_MAP(this)) { | 426 if (!IS_MAP(this)) { |
425 throw MakeTypeError(kIncompatibleMethodReceiver, | 427 throw MakeTypeError(kIncompatibleMethodReceiver, |
426 'Map.prototype.forEach', this); | 428 'Map.prototype.forEach', this); |
427 } | 429 } |
428 | 430 |
429 if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f); | 431 if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f); |
430 | 432 |
431 var iterator = new MapIterator(this, ITERATOR_KIND_ENTRIES); | 433 var iterator = new MapIterator(this, ITERATOR_KIND_ENTRIES); |
| 434 var stepping = DEBUG_IS_STEPPING(f); |
432 var value_array = [UNDEFINED, UNDEFINED]; | 435 var value_array = [UNDEFINED, UNDEFINED]; |
433 while (%MapIteratorNext(iterator, value_array)) { | 436 while (%MapIteratorNext(iterator, value_array)) { |
| 437 if (stepping) %DebugPrepareStepInIfStepping(f); |
434 %_Call(f, receiver, value_array[1], value_array[0], this); | 438 %_Call(f, receiver, value_array[1], value_array[0], this); |
435 } | 439 } |
436 } | 440 } |
437 | 441 |
438 // ------------------------------------------------------------------- | 442 // ------------------------------------------------------------------- |
439 | 443 |
440 %SetCode(GlobalMap, MapConstructor); | 444 %SetCode(GlobalMap, MapConstructor); |
441 %FunctionSetLength(GlobalMap, 0); | 445 %FunctionSetLength(GlobalMap, 0); |
442 %FunctionSetPrototype(GlobalMap, new GlobalObject()); | 446 %FunctionSetPrototype(GlobalMap, new GlobalObject()); |
443 %AddNamedProperty(GlobalMap.prototype, "constructor", GlobalMap, DONT_ENUM); | 447 %AddNamedProperty(GlobalMap.prototype, "constructor", GlobalMap, DONT_ENUM); |
(...skipping 25 matching lines...) Expand all Loading... |
469 "set_has", SetHas, | 473 "set_has", SetHas, |
470 "set_delete", SetDelete, | 474 "set_delete", SetDelete, |
471 ]); | 475 ]); |
472 | 476 |
473 utils.Export(function(to) { | 477 utils.Export(function(to) { |
474 to.GetExistingHash = GetExistingHash; | 478 to.GetExistingHash = GetExistingHash; |
475 to.GetHash = GetHash; | 479 to.GetHash = GetHash; |
476 }); | 480 }); |
477 | 481 |
478 }) | 482 }) |
OLD | NEW |