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

Unified Diff: test/mjsunit/harmony/debug-blockscopes.js

Issue 7616009: Parse harmony let declarations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated tests. Created 9 years, 4 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/mjsunit/harmony/debug-blockscopes.js
diff --git a/test/mjsunit/harmony/debug-blockscopes.js b/test/mjsunit/harmony/debug-blockscopes.js
index 30f681f129da92cdc6a97fea1cd0bb26c1e91a23..e0df71b2dfe9a6df1898b3d0446a889934312e0b 100644
--- a/test/mjsunit/harmony/debug-blockscopes.js
+++ b/test/mjsunit/harmony/debug-blockscopes.js
@@ -157,7 +157,6 @@ function CheckScopeContent(content, number, exec_state) {
scope_size--;
}
- // TODO(keuchel): print('count' + count + ' scopesize' + scope_size);
if (count != scope_size) {
print('Names found in scope:');
var names = scope.scopeObject().propertyNames();
@@ -236,7 +235,7 @@ EndTest();
BeginTest("Local 3");
function local_3(a) {
- var x = 3;
+ let x = 3;
debugger;
}
@@ -253,8 +252,8 @@ EndTest();
BeginTest("Local 4");
function local_4(a, b) {
- var x = 3;
- var y = 4;
+ let x = 3;
+ let y = 4;
debugger;
}
@@ -361,29 +360,30 @@ with_block_4();
EndTest();
-// TODO(keuchel):
// Simple closure formed by returning an inner function referering to an outer
// block local variable and an outer function's parameter.
-// BeginTest("Closure 1");
-//
-// function closure_1(a) {
-// {
-// let x = 3;
-// function f() {
-// debugger;
-// return a + x;
-// };
-// }
-// return f;
-// }
-//
-// listener_delegate = function(exec_state) {
-// CheckScopeChain([debug.ScopeType.Local,
-// debug.ScopeType.Closure,
-// debug.ScopeType.Global], exec_state);
-// // CheckScopeContent({}, 0, exec_state);
-// // CheckScopeContent({}, 1, exec_state);
-// // CheckScopeContent({a:1}, 2, exec_state);
-// };
-// closure_1(1)();
-// EndTest();
+BeginTest("Closure 1");
+
+function closure_1(a) {
+ var x = 2;
+ let y = 3;
+ if (true) {
+ let z = 4;
+ function f() {
+ debugger;
+ return a + x + y + z;
+ };
+ return f;
+ }
+}
+
+listener_delegate = function(exec_state) {
+ CheckScopeChain([debug.ScopeType.Local,
+ debug.ScopeType.Block,
+ debug.ScopeType.Closure,
+ debug.ScopeType.Global], exec_state);
+ CheckScopeContent({}, 0, exec_state);
+ CheckScopeContent({a:1,x:2,y:3}, 2, exec_state);
+};
+closure_1(1)();
+EndTest();

Powered by Google App Engine
This is Rietveld 408576698