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

Unified Diff: test/mjsunit/harmony/debug-function-scopes.js

Issue 726643002: harmony-scoping: Implement debugger support for script scope. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Minor nits Created 6 years, 1 month 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
Index: test/mjsunit/harmony/debug-function-scopes.js
diff --git a/test/mjsunit/harmony/debug-function-scopes.js b/test/mjsunit/harmony/debug-function-scopes.js
index 0113be672b0931e89c2f076f1966aa07d7c0b7e5..ce2f359180e32714bfcc658ad61c68df92c7bef7 100644
--- a/test/mjsunit/harmony/debug-function-scopes.js
+++ b/test/mjsunit/harmony/debug-function-scopes.js
@@ -28,6 +28,7 @@
// Flags: --expose-debug-as debug --harmony-scoping
"use strict";
+let top_level_let = 255;
// Get the Debug object exposed from the debug context global object.
var Debug = debug.Debug;
@@ -46,11 +47,12 @@ function CheckScope(scope_mirror, scope_expectations, expected_scope_type) {
// A copy of the scope types from mirror-debugger.js.
var ScopeType = { Global: 0,
- Local: 1,
- With: 2,
- Closure: 3,
- Catch: 4,
- Block: 5 };
+ Script: 1,
aandrey 2014/11/14 15:58:47 update
+ Local: 2,
+ With: 3,
+ Closure: 4,
+ Catch: 5,
+ Block: 6 };
var f1 = (function F1(x) {
function F2(y) {
@@ -72,12 +74,13 @@ var f1 = (function F1(x) {
var mirror = Debug.MakeMirror(f1);
-assertEquals(4, mirror.scopeCount());
+assertEquals(5, mirror.scopeCount());
CheckScope(mirror.scope(0), { a: 4, b: 5 }, ScopeType.Closure);
CheckScope(mirror.scope(1), { z: 22, w: 5, v: "Capybara" }, ScopeType.Closure);
CheckScope(mirror.scope(2), { x: 5 }, ScopeType.Closure);
-CheckScope(mirror.scope(3), {}, ScopeType.Global);
+CheckScope(mirror.scope(3), { top_level_let: 255 }, ScopeType.Script);
+CheckScope(mirror.scope(4), {}, ScopeType.Global);
var f2 = (function() {
var v1 = 3;
@@ -104,7 +107,7 @@ var f2 = (function() {
var mirror = Debug.MakeMirror(f2);
-assertEquals(5, mirror.scopeCount());
+assertEquals(6, mirror.scopeCount());
// Implementation artifact: l4 isn't used in closure, but still it is saved.
CheckScope(mirror.scope(0), { l4: 11 }, ScopeType.Block);
@@ -112,4 +115,5 @@ CheckScope(mirror.scope(0), { l4: 11 }, ScopeType.Block);
CheckScope(mirror.scope(1), { l3: 9 }, ScopeType.Block);
CheckScope(mirror.scope(2), { l1: 6, l2: 7 }, ScopeType.Block);
CheckScope(mirror.scope(3), { v1:3, l0: 0, v3: 5, v6: 11 }, ScopeType.Closure);
-CheckScope(mirror.scope(4), {}, ScopeType.Global);
+CheckScope(mirror.scope(4), { top_level_let: 255 }, ScopeType.Script);
+CheckScope(mirror.scope(5), {}, ScopeType.Global);
« test/mjsunit/debug-function-scopes.js ('K') | « test/mjsunit/harmony/debug-blockscopes.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698