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

Unified Diff: test/mjsunit/es6/debug-stepin-promises.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: fixed test 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/debug-stepin-foreach.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/debug-stepin-promises.js
diff --git a/test/mjsunit/debug-stepin-foreach.js b/test/mjsunit/es6/debug-stepin-promises.js
similarity index 64%
copy from test/mjsunit/debug-stepin-foreach.js
copy to test/mjsunit/es6/debug-stepin-promises.js
index fa728e019c11ed204a6a751e925598d3eab30ea4..8548a2badda1daaf6e7a9a9573604a29a3a5f730 100644
--- a/test/mjsunit/debug-stepin-foreach.js
+++ b/test/mjsunit/es6/debug-stepin-promises.js
@@ -1,9 +1,9 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
+// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --expose-debug-as debug
-// Tests stepping into through Array.prototype.forEach callbacks.
+// Flags: --expose-debug-as debug --allow-natives-syntax --noalways-opt
+// Tests stepping into through Promises.
Debug = debug.Debug
var exception = null;
@@ -38,14 +38,28 @@ function listener(event, exec_state, event_data, data) {
Debug.setListener(listener);
-debugger; // Break 0.
-[1,2].forEach(callback); // Break 1.
+Promise.resolve(42)
+ .then(
+ function f0() {
+ debugger; // Break 0.
+ } // Break 1.
+ )
+ .then(callback)
+ .then(callback.bind(null))
+ .then(Object)
+ .then(callback.bind(null).bind(null))
+ .then(finalize)
+ .catch(function(err) {
+ %AbortJS("FAIL: " + err);
+ });
function callback(x) {
- return x; // Break 2. // Break 4.
-} // Break 3. // Break 5.
+ return x; // Break 2. // Break 4. // Break 6.
+} // Break 3. // Break 5. // Break 7.
-assertNull(exception); // Break 6.
-assertEquals(expected_breaks, break_count);
+function finalize() {
+ assertNull(exception); // Break 8.
+ assertEquals(expected_breaks, break_count);
-Debug.setListener(null);
+ Debug.setListener(null);
+}
« no previous file with comments | « test/mjsunit/debug-stepin-foreach.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698