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

Unified Diff: test/mjsunit/regress/regress-crbug-605581.js

Issue 1920953003: [debugger] add test case for debug-evaluate for values in TDZ. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-crbug-605581.js
diff --git a/test/mjsunit/debug-evaluate-modify-this.js b/test/mjsunit/regress/regress-crbug-605581.js
similarity index 60%
copy from test/mjsunit/debug-evaluate-modify-this.js
copy to test/mjsunit/regress/regress-crbug-605581.js
index 930f6ed0431078cd02d6253bdedb1dd4f76560b1..0f1daabead95a6357503f418c5b46c710ba6b99b 100644
--- a/test/mjsunit/debug-evaluate-modify-this.js
+++ b/test/mjsunit/regress/regress-crbug-605581.js
@@ -4,30 +4,25 @@
// Flags: --expose-debug-as debug
-Debug = debug.Debug
-
+var Debug = debug.Debug;
var exception = null;
-var f = () => { debugger; }
-var g = function() { debugger; }
-var h = (function() { return () => { debugger; }; }).call({});
-
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
- assertThrows(() => exec_state.frame(0).evaluate("this = 2"));
+ assertThrows(() => exec_state.frame(0).evaluate("bar.baz"), ReferenceError);
} catch (e) {
exception = e;
- print("Caught something. " + e + " " + e.stack);
- };
-};
+ }
+}
Debug.setListener(listener);
-f();
-g();
-g.call({});
-h();
+(function() {
+ debugger; // bar is still in TDZ at this point.
+ let bar = 1;
+ (x => bar); // force bar to be context-allocated.
+})();
Debug.setListener(null);
assertNull(exception);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698