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

Unified Diff: test/cctest/test-decls.cc

Issue 10872084: Allocate block-scoped global bindings to global context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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/cctest/test-decls.cc
diff --git a/test/cctest/test-decls.cc b/test/cctest/test-decls.cc
index 42e7e78d7f6c2015554f9c624621c2685312ac75..6fc601213c67bc32e268a10493e442b102b373e8 100644
--- a/test/cctest/test-decls.cc
+++ b/test/cctest/test-decls.cc
@@ -786,12 +786,24 @@ TEST(MultiScriptConflicts) {
}
{ SimpleContext context;
+ context.Check("function x() { return 4 }; x()",
+ EXPECT_RESULT, Number::New(4));
+ context.Check("x()",
+ EXPECT_RESULT, Number::New(4));
+ context.Check("this.x()",
+ EXPECT_RESULT, Number::New(4));
+ }
+
+ { SimpleContext context;
context.Check("let x = 2; x",
EXPECT_RESULT, Number::New(2));
context.Check("x",
EXPECT_RESULT, Number::New(2));
- context.Check("this.x",
- EXPECT_RESULT, Number::New(2));
+ // TODO(rossberg): The current ES6 draft spec does not reflect lexical
+ // bindings on the global object. However, this will probably change, in
+ // which case we reactivate the following test.
+ // context.Check("this.x",
+ // EXPECT_RESULT, Number::New(2));
}
{ SimpleContext context;
@@ -799,17 +811,11 @@ TEST(MultiScriptConflicts) {
EXPECT_RESULT, Number::New(3));
context.Check("x",
EXPECT_RESULT, Number::New(3));
- context.Check("this.x",
- EXPECT_RESULT, Number::New(3));
- }
-
- { SimpleContext context;
- context.Check("function x() { return 4 }; x()",
- EXPECT_RESULT, Number::New(4));
- context.Check("x()",
- EXPECT_RESULT, Number::New(4));
- context.Check("this.x()",
- EXPECT_RESULT, Number::New(4));
+ // TODO(rossberg): The current ES6 draft spec does not reflect lexical
+ // bindings on the global object. However, this will probably change, in
+ // which case we reactivate the following test.
+ // context.Check("this.x",
+ // EXPECT_RESULT, Number::New(3));
}
// TODO(rossberg): All of the below should actually be errors in Harmony.
@@ -846,55 +852,55 @@ TEST(MultiScriptConflicts) {
context.Check("let x = 1; x",
EXPECT_RESULT, Number::New(1));
context.Check("var x = 2; x",
- EXPECT_RESULT, Number::New(2));
+ EXPECT_ERROR);
}
{ SimpleContext context;
context.Check("let x = 1; x",
EXPECT_RESULT, Number::New(1));
context.Check("let x = 2; x",
- EXPECT_RESULT, Number::New(2));
+ EXPECT_ERROR);
}
{ SimpleContext context;
context.Check("let x = 1; x",
EXPECT_RESULT, Number::New(1));
context.Check("const x = 2; x",
- EXPECT_RESULT, Number::New(2));
+ EXPECT_ERROR);
}
{ SimpleContext context;
context.Check("let x = 1; x",
EXPECT_RESULT, Number::New(1));
context.Check("function x() { return 2 }; x()",
- EXPECT_RESULT, Number::New(2));
+ EXPECT_ERROR);
}
{ SimpleContext context;
context.Check("const x = 1; x",
EXPECT_RESULT, Number::New(1));
context.Check("var x = 2; x",
- EXPECT_RESULT, Number::New(1));
+ EXPECT_ERROR);
}
{ SimpleContext context;
context.Check("const x = 1; x",
EXPECT_RESULT, Number::New(1));
context.Check("let x = 2; x",
- EXPECT_EXCEPTION);
+ EXPECT_ERROR);
}
{ SimpleContext context;
context.Check("const x = 1; x",
EXPECT_RESULT, Number::New(1));
context.Check("const x = 2; x",
- EXPECT_RESULT, Number::New(1));
+ EXPECT_ERROR);
}
{ SimpleContext context;
context.Check("const x = 1; x",
EXPECT_RESULT, Number::New(1));
context.Check("function x() { return 2 }; x()",
- EXPECT_EXCEPTION);
+ EXPECT_ERROR);
}
}
« src/parser.cc ('K') | « src/variables.cc ('k') | test/mjsunit/harmony/block-conflicts.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698