summaryrefslogtreecommitdiff
path: root/deps/v8/test/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/debugger')
-rw-r--r--deps/v8/test/debugger/debug/debug-evaluate-shadowed-context-3.js39
-rw-r--r--deps/v8/test/debugger/debug/es6/generators-relocation.js3
-rw-r--r--deps/v8/test/debugger/debugger.status9
-rw-r--r--deps/v8/test/debugger/regress/regress-9482.js32
4 files changed, 83 insertions, 0 deletions
diff --git a/deps/v8/test/debugger/debug/debug-evaluate-shadowed-context-3.js b/deps/v8/test/debugger/debug/debug-evaluate-shadowed-context-3.js
new file mode 100644
index 0000000000..2a41109565
--- /dev/null
+++ b/deps/v8/test/debugger/debug/debug-evaluate-shadowed-context-3.js
@@ -0,0 +1,39 @@
+// Copyright 2019 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.
+
+// Test that debug-evaluate properly shadows stack-allocated variables.
+
+Debug = debug.Debug
+
+let exception = null;
+function listener(event, exec_state, event_data, data) {
+ if (event != Debug.DebugEvent.Break) return;
+ try {
+ assertEquals(2, exec_state.frame(0).evaluate("b").value());
+ assertEquals(3, exec_state.frame(0).evaluate("c").value())
+ assertThrows(() => exec_state.frame(0).evaluate("a").value());
+ } catch (e) {
+ exception = e;
+ print(e + e.stack);
+ }
+}
+
+Debug.setListener(listener);
+
+(function f() {
+ let a = 1;
+ let b = 2;
+ let c = 3;
+ () => a + c; // a and c are context-allocated
+ return function g() {
+ let a = 2; // a is stack-allocated
+ return function h() {
+ b; // b is allocated onto f's context.
+ debugger;
+ }
+ }
+})()()();
+
+Debug.setListener(null);
+assertNull(exception);
diff --git a/deps/v8/test/debugger/debug/es6/generators-relocation.js b/deps/v8/test/debugger/debug/es6/generators-relocation.js
index 78413fde6e..13ebb01d0f 100644
--- a/deps/v8/test/debugger/debug/es6/generators-relocation.js
+++ b/deps/v8/test/debugger/debug/es6/generators-relocation.js
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// Flags: --expose-gc
var Debug = debug.Debug;
@@ -28,6 +29,8 @@ function RunTest(formals_and_body, args, value1, value2) {
// function and relocation of the suspended generator activation.
Debug.setListener(listener);
+ gc();
+
// Add a breakpoint on line 3 (the second yield).
var bp = Debug.setBreakPoint(gen, 3);
diff --git a/deps/v8/test/debugger/debugger.status b/deps/v8/test/debugger/debugger.status
index 503e5e7145..85e4cec3ee 100644
--- a/deps/v8/test/debugger/debugger.status
+++ b/deps/v8/test/debugger/debugger.status
@@ -11,6 +11,9 @@
# not work, but we expect it to not crash.
'debug/debug-step-turbofan': [PASS, FAIL],
+ # BUG (v8:9721)
+ 'debug/es6/generators-relocation': [FAIL],
+
# Issue 3641: The new 'then' semantics suppress some exceptions.
# These tests may be changed or removed when 'chain' is deprecated.
'debug/es6/debug-promises/reject-with-throw-in-reject': [FAIL],
@@ -136,4 +139,10 @@
'*': [SKIP],
}], # variant == jitless and not embedded_builtins
+##############################################################################
+['variant == turboprop', {
+ # Deopts differently than TurboFan.
+ 'debug/debug-optimize': [SKIP],
+}], # variant == turboprop
+
]
diff --git a/deps/v8/test/debugger/regress/regress-9482.js b/deps/v8/test/debugger/regress/regress-9482.js
new file mode 100644
index 0000000000..e07c660a08
--- /dev/null
+++ b/deps/v8/test/debugger/regress/regress-9482.js
@@ -0,0 +1,32 @@
+// Copyright 2019 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.
+
+Debug = debug.Debug
+var exception = null;
+
+function listener(event, exec_state, event_data, data) {
+ try {
+ if (event == Debug.DebugEvent.Break) {
+ assertEquals("n", exec_state.frame(0).evaluate("n").value());
+ assertEquals("m", exec_state.frame(0).evaluate("m").value());
+ }
+ } catch(e) {
+ exception = e;
+ print(e, e.stack);
+ }
+};
+
+Debug.setListener(listener);
+
+(function foo () {
+ var n = "n";
+ var m = "m";
+ (function bar() {
+ assertEquals("m", eval("m")); // force context-allocation.
+ debugger;
+ })();
+})();
+
+assertNull(exception);
+Debug.setListener(null);