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

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

Issue 1704223002: Remove strong mode support from Scope and Variable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove test-parsing test Created 4 years, 10 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
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/mjsunit/strong/declaration-after-use.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index d0aa54815ca5d6f9794e9b2a562376c7615385c5..b04fb94d3ac92801f23ef9b44ecade040319e1a8 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -6658,61 +6658,6 @@ TEST(StrongModeFreeVariablesDeclaredInGlobalPrototype) {
}
-TEST(StrongModeFreeVariablesNotDeclared) {
- i::FLAG_strong_mode = true;
- v8::V8::Initialize();
- v8::HandleScope scope(CcTest::isolate());
- v8::Context::Scope context_scope(v8::Context::New(CcTest::isolate()));
- v8::TryCatch try_catch(CcTest::isolate());
-
- // Test that referencing unintroduced variables in sloppy mode is ok.
- const char* script1 =
- "if (false) { \n"
- " not_there1; \n"
- "} \n";
- CompileRun(v8_str(script1));
- CHECK(!try_catch.HasCaught());
-
- // But not in strong mode.
- {
- const char* script2 =
- "\"use strong\"; \n"
- "if (false) { \n"
- " not_there2; \n"
- "} \n";
- v8::TryCatch try_catch2(CcTest::isolate());
- v8_compile(v8_str(script2));
- CHECK(try_catch2.HasCaught());
- v8::String::Utf8Value exception(try_catch2.Exception());
- CHECK_EQ(0,
- strcmp(
- "ReferenceError: In strong mode, using an undeclared global "
- "variable 'not_there2' is not allowed",
- *exception));
- }
-
- // Check that the variable reference is detected inside a strong function too,
- // even if the script scope is not strong.
- {
- const char* script3 =
- "(function not_lazy() { \n"
- " \"use strong\"; \n"
- " if (false) { \n"
- " not_there3; \n"
- " } \n"
- "})(); \n";
- v8::TryCatch try_catch2(CcTest::isolate());
- v8_compile(v8_str(script3));
- CHECK(try_catch2.HasCaught());
- v8::String::Utf8Value exception(try_catch2.Exception());
- CHECK_EQ(0,
- strcmp(
- "ReferenceError: In strong mode, using an undeclared global "
- "variable 'not_there3' is not allowed",
- *exception));
- }
-}
-
static const ParserFlag kAllDestructuringFlags[] = {
kAllowHarmonyDestructuring, kAllowHarmonyDestructuringAssignment,
kAllowHarmonyDefaultParameters};
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/mjsunit/strong/declaration-after-use.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698