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

Side by Side Diff: src/collection.js

Issue 1030673002: Make debugger step into bound callbacks passed to Array.forEach. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
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 "use strict"; 5 "use strict";
6 6
7 // This file relies on the fact that the following declaration has been made 7 // This file relies on the fact that the following declaration has been made
8 // in runtime.js: 8 // in runtime.js:
9 // var $Array = global.Array; 9 // var $Array = global.Array;
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 var needs_wrapper = false; 99 var needs_wrapper = false;
100 if (IS_NULL_OR_UNDEFINED(receiver)) { 100 if (IS_NULL_OR_UNDEFINED(receiver)) {
101 receiver = %GetDefaultReceiver(f) || receiver; 101 receiver = %GetDefaultReceiver(f) || receiver;
102 } else { 102 } else {
103 needs_wrapper = SHOULD_CREATE_WRAPPER(f, receiver); 103 needs_wrapper = SHOULD_CREATE_WRAPPER(f, receiver);
104 } 104 }
105 105
106 var iterator = new SetIterator(this, ITERATOR_KIND_VALUES); 106 var iterator = new SetIterator(this, ITERATOR_KIND_VALUES);
107 var key; 107 var key;
108 var stepping = DEBUG_IS_ACTIVE && %DebugCallbackSupportsStepping(f); 108 var stepping = DEBUG_IS_STEPPING();
109 var value_array = [UNDEFINED]; 109 var value_array = [UNDEFINED];
110 while (%SetIteratorNext(iterator, value_array)) { 110 while (%SetIteratorNext(iterator, value_array)) {
111 if (stepping) %DebugPrepareStepInIfStepping(f); 111 if (stepping) %DebugPrepareStepInIfStepping(f);
112 key = value_array[0]; 112 key = value_array[0];
113 var new_receiver = needs_wrapper ? ToObject(receiver) : receiver; 113 var new_receiver = needs_wrapper ? ToObject(receiver) : receiver;
114 %_CallFunction(new_receiver, key, key, this, f); 114 %_CallFunction(new_receiver, key, key, this, f);
115 } 115 }
116 } 116 }
117 117
118 118
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 throw MakeTypeError('called_non_callable', [f]); 240 throw MakeTypeError('called_non_callable', [f]);
241 } 241 }
242 var needs_wrapper = false; 242 var needs_wrapper = false;
243 if (IS_NULL_OR_UNDEFINED(receiver)) { 243 if (IS_NULL_OR_UNDEFINED(receiver)) {
244 receiver = %GetDefaultReceiver(f) || receiver; 244 receiver = %GetDefaultReceiver(f) || receiver;
245 } else { 245 } else {
246 needs_wrapper = SHOULD_CREATE_WRAPPER(f, receiver); 246 needs_wrapper = SHOULD_CREATE_WRAPPER(f, receiver);
247 } 247 }
248 248
249 var iterator = new MapIterator(this, ITERATOR_KIND_ENTRIES); 249 var iterator = new MapIterator(this, ITERATOR_KIND_ENTRIES);
250 var stepping = DEBUG_IS_ACTIVE && %DebugCallbackSupportsStepping(f); 250 var stepping = DEBUG_IS_STEPPING();
251 var value_array = [UNDEFINED, UNDEFINED]; 251 var value_array = [UNDEFINED, UNDEFINED];
252 while (%MapIteratorNext(iterator, value_array)) { 252 while (%MapIteratorNext(iterator, value_array)) {
253 if (stepping) %DebugPrepareStepInIfStepping(f); 253 if (stepping) %DebugPrepareStepInIfStepping(f);
254 var new_receiver = needs_wrapper ? ToObject(receiver) : receiver; 254 var new_receiver = needs_wrapper ? ToObject(receiver) : receiver;
255 %_CallFunction(new_receiver, value_array[1], value_array[0], this, f); 255 %_CallFunction(new_receiver, value_array[1], value_array[0], this, f);
256 } 256 }
257 } 257 }
258 258
259 259
260 // ------------------------------------------------------------------- 260 // -------------------------------------------------------------------
(...skipping 15 matching lines...) Expand all
276 "get", MapGetJS, 276 "get", MapGetJS,
277 "set", MapSetJS, 277 "set", MapSetJS,
278 "has", MapHasJS, 278 "has", MapHasJS,
279 "delete", MapDeleteJS, 279 "delete", MapDeleteJS,
280 "clear", MapClearJS, 280 "clear", MapClearJS,
281 "forEach", MapForEach 281 "forEach", MapForEach
282 )); 282 ));
283 } 283 }
284 284
285 SetUpMap(); 285 SetUpMap();
OLDNEW
« no previous file with comments | « src/array.js ('k') | src/harmony-typedarray.js » ('j') | src/runtime/runtime-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698