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

Unified Diff: test/mjsunit/es6/regress/regress-468661.js

Issue 1032653002: Do not assign positions to parser-generated desugarings. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased for landing 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 | « src/parser.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/regress/regress-468661.js
diff --git a/test/mjsunit/debug-stepin-foreach.js b/test/mjsunit/es6/regress/regress-468661.js
similarity index 54%
copy from test/mjsunit/debug-stepin-foreach.js
copy to test/mjsunit/es6/regress/regress-468661.js
index c2702f794a989bc48a1099f3a1ea4d9291d6ea94..e3886ca181f8cff8f31298d9cb33ecd058428280 100644
--- a/test/mjsunit/debug-stepin-foreach.js
+++ b/test/mjsunit/es6/regress/regress-468661.js
@@ -1,33 +1,50 @@
-// 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.
Debug = debug.Debug
var exception = null;
var break_count = 0;
-var expected_breaks = -1;
+
+var expected_values =
+ [ReferenceError, ReferenceError, 0, 0, 0, 0, 0, 1, ReferenceError, ReferenceError];
function listener(event, exec_state, event_data, data) {
try {
if (event == Debug.DebugEvent.Break) {
assertTrue(exec_state.frameCount() != 0, "FAIL: Empty stack trace");
+ // Count number of expected breakpoints in this source file.
if (!break_count) {
- // Count number of expected breakpoints in this source file.
var source_text = exec_state.frame(0).func().script().source();
expected_breaks = source_text.match(/\/\/\s*Break\s+\d+\./g).length;
print("Expected breaks: " + expected_breaks);
}
- var source = exec_state.frame(0).sourceLineText();
+ var frameMirror = exec_state.frame(0);
+
+ var v = null;;
+ try {
+ v = frameMirror.evaluate('i').value();
+ } catch(e) {
+ v = e;
+ }
+
+ var source = frameMirror.sourceLineText();
print("paused at: " + source);
assertTrue(source.indexOf("// Break " + break_count + ".") > 0,
"Unexpected pause at: " + source + "\n" +
"Expected: // Break " + break_count + ".");
+ if (expected_values[break_count] === ReferenceError) {
+ assertTrue(v instanceof ReferenceError);
+ } else {
+ assertSame(expected_values[break_count], v);
+ }
++break_count;
+
if (break_count !== expected_breaks) {
exec_state.prepareStep(Debug.StepAction.StepIn, 1);
+ print("Next step prepared");
}
}
} catch(e) {
@@ -37,17 +54,22 @@ function listener(event, exec_state, event_data, data) {
};
Debug.setListener(listener);
-var bound_callback = callback.bind(null);
-debugger; // Break 0.
-[1,2].forEach(callback); // Break 1.
-[3,4].forEach(bound_callback); // Break 6.
+var sum = 0;
+(function (){
+ 'use strict';
-function callback(x) {
- return x; // Break 2. // Break 4. // Break 7. // Break 9.
-} // Break 3. // Break 5. // Break 8. // Break 10.
+ debugger; // Break 0.
+
+ for (let i=0; // Break 1.
+ i < 1; // Break 2. // Break 3. // Break 6. // Break 7.
+ i++) {
+ let key = i; // Break 4.
+ sum += key; // Break 5.
+ }
+}()); // Break 8.
-assertNull(exception); // Break 11.
+assertNull(exception); // Break 9.
assertEquals(expected_breaks, break_count);
Debug.setListener(null);
« no previous file with comments | « src/parser.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698