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

Unified Diff: test/debugger/debug/debug-scopes-suspended-generators.js

Issue 2898163002: Make non-Module generators only context allocate parameters. (Closed)
Patch Set: Rebase Created 3 years, 7 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
Index: test/debugger/debug/debug-scopes-suspended-generators.js
diff --git a/test/debugger/debug/debug-scopes-suspended-generators.js b/test/debugger/debug/debug-scopes-suspended-generators.js
index cf1b6468aa21e577bf0f8d1f05816a6fbca301cb..6d78b64d6c366c70d6a104fffa15799a008eae2f 100644
--- a/test/debugger/debug/debug-scopes-suspended-generators.js
+++ b/test/debugger/debug/debug-scopes-suspended-generators.js
@@ -107,7 +107,7 @@ function *gen1() {
}
var g = gen1();
-CheckScopeChain([debug.ScopeType.Closure,
+CheckScopeChain([debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({}, 0, g);
@@ -120,7 +120,7 @@ function *gen2(a) {
}
g = gen2(42);
-CheckScopeChain([debug.ScopeType.Closure,
+CheckScopeChain([debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({a: 42}, 0, g);
@@ -134,7 +134,7 @@ function *gen3(a) {
}
g = gen3(0);
-CheckScopeChain([debug.ScopeType.Closure,
+CheckScopeChain([debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({a: 0, b: undefined}, 0, g);
@@ -148,11 +148,12 @@ function *gen4(a, b) {
var x = 2;
yield a;
var y = 3;
+ yield a;
return b;
}
g = gen4(0, 1);
-CheckScopeChain([debug.ScopeType.Closure,
+CheckScopeChain([debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({a: 0, b: 1, x: undefined, y: undefined}, 0, g);
@@ -167,12 +168,13 @@ CheckScopeContent({a: 0, b: 1, x: 2, y: 3}, 0, g);
function *gen5(a) {
eval('var b = 2');
+ yield a;
return b;
}
g = gen5(1);
g.next();
-CheckScopeChain([debug.ScopeType.Closure,
+CheckScopeChain([debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({a: 1, b: 2}, 0, g);
@@ -190,13 +192,13 @@ function *gen6() {
g = gen6();
g.next();
CheckScopeChain([debug.ScopeType.With,
- debug.ScopeType.Closure,
+ debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({}, 0, g);
g.next();
-CheckScopeChain([debug.ScopeType.Closure,
+CheckScopeChain([debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
@@ -216,7 +218,7 @@ g = gen7();
g.next();
CheckScopeChain([debug.ScopeType.With,
debug.ScopeType.With,
- debug.ScopeType.Closure,
+ debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({}, 0, g);
@@ -237,7 +239,7 @@ g = gen8();
g.next();
CheckScopeChain([debug.ScopeType.With,
debug.ScopeType.With,
- debug.ScopeType.Closure,
+ debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({a: 2, b: 1}, 0, g);
@@ -259,7 +261,7 @@ function *gen9() {
g = gen9();
g.next();
CheckScopeChain([debug.ScopeType.Catch,
- debug.ScopeType.Closure,
+ debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({e: 42}, 0, g);
@@ -274,24 +276,23 @@ function *gen10() {
g = gen10();
g.next();
CheckScopeChain([debug.ScopeType.Block,
- debug.ScopeType.Block,
- debug.ScopeType.Closure,
+ debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({i: 0}, 0, g);
g.next();
CheckScopeContent({i: 1}, 0, g);
-CheckScopeContent({i: 0}, 1, g); // Additional block scope with i = 0;
// Nested generators.
var gen12;
function *gen11() {
+ var b = 2;
gen12 = function*() {
var a = 1;
yield 1;
- return 2;
+ return b;
}();
var a = 0;
@@ -301,12 +302,12 @@ function *gen11() {
gen11().next();
g = gen12;
-CheckScopeChain([debug.ScopeType.Closure,
+CheckScopeChain([debug.ScopeType.Local,
debug.ScopeType.Closure,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({a: 1}, 0, g);
-CheckScopeContent({a: 0}, 1, g);
+CheckScopeContent({b: 2}, 1, g);
// Set a variable in an empty scope.
@@ -355,7 +356,7 @@ var g = gen15();
assertEquals(1, g.next().value);
CheckScopeChain([debug.ScopeType.With,
- debug.ScopeType.Closure,
+ debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({a: 1, b: 2}, 0, g);
@@ -376,7 +377,7 @@ CheckScopeContent({a: 1, b: 2}, 0, g);
CheckScopeContent({c: 1, d: 4, e: 42}, 1, g);
assertEquals(5, g.next().value); // Initialized after set.
-CheckScopeChain([debug.ScopeType.Closure,
+CheckScopeChain([debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
@@ -404,15 +405,15 @@ g.next();
CheckScopeChain([debug.ScopeType.Block,
debug.ScopeType.With,
- debug.ScopeType.Closure,
+ debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
-CheckScopeContent({d: 4}, 0, g);
+CheckScopeContent({d: 4, e: undefined}, 0, g);
CheckScopeContent({a: 1, b: 2}, 1, g);
CheckScopeContent({c: 3}, 2, g);
Debug.generatorScope(g, 0).setVariableValue("d", 1);
-CheckScopeContent({d: 1}, 0, g);
+CheckScopeContent({d: 1, e: undefined}, 0, g);
assertEquals(1, g.next().value);
@@ -434,7 +435,7 @@ g = gen17();
g.next();
CheckScopeChain([debug.ScopeType.Catch,
- debug.ScopeType.Closure,
+ debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], g);
CheckScopeContent({e: 42}, 0, g);

Powered by Google App Engine
This is Rietveld 408576698