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

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

Issue 1819123002: Remove support for legacy const, part 1 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased, deleted one more file Created 4 years, 9 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 | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/cctest/test-decls.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-interpreter.cc
diff --git a/test/cctest/interpreter/test-interpreter.cc b/test/cctest/interpreter/test-interpreter.cc
index 8f236a14392962ed508da3658c2ef6d9de24c220..511e891d4939f0cda370d05496158367ca01dfb8 100644
--- a/test/cctest/interpreter/test-interpreter.cc
+++ b/test/cctest/interpreter/test-interpreter.cc
@@ -4008,29 +4008,6 @@ TEST(InterpreterConstInLookupContextChain) {
Handle<i::Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*const_decl[i].second));
}
-
- // Tests for Legacy constant.
- bool old_flag_legacy_const = FLAG_legacy_const;
- FLAG_legacy_const = true;
-
- std::pair<const char*, Handle<Object>> legacy_const_decl[] = {
- {"return outerConst = 23;", handle(Smi::FromInt(23), isolate)},
- {"outerConst = 30; return outerConst;",
- handle(Smi::FromInt(10), isolate)},
- };
-
- for (size_t i = 0; i < arraysize(legacy_const_decl); i++) {
- std::string script = std::string(prologue) +
- std::string(legacy_const_decl[i].first) +
- std::string(epilogue);
- InterpreterTester tester(handles.main_isolate(), script.c_str(), "*");
- auto callable = tester.GetCallable<>();
-
- Handle<i::Object> return_value = callable().ToHandleChecked();
- CHECK(return_value->SameValue(*legacy_const_decl[i].second));
- }
-
- FLAG_legacy_const = old_flag_legacy_const;
}
TEST(InterpreterIllegalConstDeclaration) {
@@ -4076,39 +4053,6 @@ TEST(InterpreterIllegalConstDeclaration) {
}
}
-TEST(InterpreterLegacyConstDeclaration) {
- bool old_flag_legacy_const = FLAG_legacy_const;
- FLAG_legacy_const = true;
-
- HandleAndZoneScope handles;
- i::Isolate* isolate = handles.main_isolate();
-
- std::pair<const char*, Handle<Object>> const_decl[] = {
- {"const x = (x = 10) + 3; return x;", handle(Smi::FromInt(13), isolate)},
- {"const x = 10; x = 20; return x;", handle(Smi::FromInt(10), isolate)},
- {"var a = 10;\n"
- "for (var i = 0; i < 10; ++i) {\n"
- " const x = i;\n" // Legacy constants are not block scoped.
- " a = a + x;\n"
- "}\n"
- "return a;\n",
- handle(Smi::FromInt(10), isolate)},
- {"const x = 20; eval('x = 10;'); return x;",
- handle(Smi::FromInt(20), isolate)},
- };
-
- for (size_t i = 0; i < arraysize(const_decl); i++) {
- std::string source(InterpreterTester::SourceForBody(const_decl[i].first));
- InterpreterTester tester(handles.main_isolate(), source.c_str());
- auto callable = tester.GetCallable<>();
-
- Handle<i::Object> return_value = callable().ToHandleChecked();
- CHECK(return_value->SameValue(*const_decl[i].second));
- }
-
- FLAG_legacy_const = old_flag_legacy_const;
-}
-
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/cctest/test-decls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698