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

Unified Diff: test/mjsunit/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: Nit + rebased 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
« no previous file with comments | « test/mjsunit/debug-evaluate-locals-optimized-double.js ('k') | test/mjsunit/debug-scopes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-function-scopes.js
diff --git a/test/mjsunit/debug-function-scopes.js b/test/mjsunit/debug-function-scopes.js
index b51e8b4432b3fb53f585d8f43b7a658eff176994..8992fe79c573e2a64bb97e9c9a5c5446db780fb9 100644
--- a/test/mjsunit/debug-function-scopes.js
+++ b/test/mjsunit/debug-function-scopes.js
@@ -48,7 +48,8 @@ var ScopeType = { Global: 0,
With: 2,
Closure: 3,
Catch: 4,
- Block: 5 };
+ Block: 5,
+ Script: 6};
var f1 = (function F1(x) {
function F2(y) {
@@ -68,21 +69,23 @@ var f1 = (function F1(x) {
var mirror = Debug.MakeMirror(f1);
-assertEquals(5, mirror.scopeCount());
+assertEquals(6, mirror.scopeCount());
CheckScope(mirror.scope(0), { a: 4, b: 5 }, ScopeType.Closure);
CheckScope(mirror.scope(1), { w: 5, v: "Capybara" }, ScopeType.With);
CheckScope(mirror.scope(2), { y: 17, z: 22 }, ScopeType.Closure);
CheckScope(mirror.scope(3), { x: 5 }, ScopeType.Closure);
-CheckScope(mirror.scope(4), {}, ScopeType.Global);
+CheckScope(mirror.scope(4), {}, ScopeType.Script);
+CheckScope(mirror.scope(5), {}, ScopeType.Global);
var f2 = function() { return 5; }
var mirror = Debug.MakeMirror(f2);
-assertEquals(1, mirror.scopeCount());
+assertEquals(2, mirror.scopeCount());
-CheckScope(mirror.scope(0), {}, ScopeType.Global);
+CheckScope(mirror.scope(0), {}, ScopeType.Script);
+CheckScope(mirror.scope(1), {}, ScopeType.Global);
var f3 = (function F1(invisible_parameter) {
var invisible1 = 1;
@@ -99,11 +102,12 @@ var f3 = (function F1(invisible_parameter) {
var mirror = Debug.MakeMirror(f3);
-assertEquals(3, mirror.scopeCount());
+assertEquals(4, mirror.scopeCount());
CheckScope(mirror.scope(0), { visible2: 20 }, ScopeType.Closure);
CheckScope(mirror.scope(1), { visible1: 10 }, ScopeType.Closure);
-CheckScope(mirror.scope(2), {}, ScopeType.Global);
+CheckScope(mirror.scope(2), {}, ScopeType.Script);
+CheckScope(mirror.scope(3), {}, ScopeType.Global);
var f4 = (function One() {
@@ -122,11 +126,12 @@ var f4 = (function One() {
var mirror = Debug.MakeMirror(f4);
-assertEquals(3, mirror.scopeCount());
+assertEquals(4, mirror.scopeCount());
CheckScope(mirror.scope(0), { e2: "I'm error 2" }, ScopeType.Catch);
CheckScope(mirror.scope(1), { e1: "I'm error 1" }, ScopeType.Catch);
-CheckScope(mirror.scope(2), {}, ScopeType.Global);
+CheckScope(mirror.scope(2), {}, ScopeType.Script);
+CheckScope(mirror.scope(3), {}, ScopeType.Global);
var f5 = (function Raz(p1, p2) {
@@ -141,11 +146,12 @@ var f5 = (function Raz(p1, p2) {
var mirror = Debug.MakeMirror(f5);
-assertEquals(3, mirror.scopeCount());
+assertEquals(4, mirror.scopeCount());
CheckScope(mirror.scope(0), { p4: 20, p6: 22 }, ScopeType.Closure);
CheckScope(mirror.scope(1), { p1: 1 }, ScopeType.Closure);
-CheckScope(mirror.scope(2), {}, ScopeType.Global);
+CheckScope(mirror.scope(2), {}, ScopeType.Script);
+CheckScope(mirror.scope(3), {}, ScopeType.Global);
function CheckNoScopeVisible(f) {
« no previous file with comments | « test/mjsunit/debug-evaluate-locals-optimized-double.js ('k') | test/mjsunit/debug-scopes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698