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

Unified Diff: test/cctest/compiler/test-run-variables.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
Index: test/cctest/compiler/test-run-variables.cc
diff --git a/test/cctest/compiler/test-run-variables.cc b/test/cctest/compiler/test-run-variables.cc
index f85636850924ba5e0e26eadb0ef62333fb8ade7a..6997967b42cb9f7d885be3868f837ad724430ce8 100644
--- a/test/cctest/compiler/test-run-variables.cc
+++ b/test/cctest/compiler/test-run-variables.cc
@@ -15,7 +15,6 @@ static const char* load_tests[] = {
"var x = (r = x)", "undefined", "undefined",
"var x = (a?1:2); r = x", "1", "2",
"const x = a; r = x", "123", "0",
- "const x = (r = x)", "undefined", "undefined",
"const x = (a?3:4); r = x", "3", "4",
"'use strict'; const x = a; r = x", "123", "0",
"'use strict'; const x = (r = x)", throws, throws,
@@ -29,9 +28,6 @@ static const char* store_tests[] = {
"var x = 1; x = a; r = x", "123", "0",
"var x = (a?(x=4,2):3); r = x", "2", "3",
"var x = (a?4:5); x = a; r = x", "123", "0",
- "const x = 1; x = a; r = x", "1", "1",
- "const x = (a?(x=4,2):3); r = x", "2", "3",
- "const x = (a?4:5); x = a; r = x", "4", "5",
// Assignments to 'const' are SyntaxErrors, handled by the parser,
// hence we cannot test them here because they are early errors.
"'use strict'; let x = 1; x = a; r = x", "123", "0",
@@ -39,16 +35,8 @@ static const char* store_tests[] = {
"'use strict'; let x = (a?4:5); x = a; r = x", "123", "0",
NULL};
-static const char* bind_tests[] = {
- "if (a) { const x = a }; r = x;", "123", "undefined",
- "for (; a > 0; a--) { const x = a }; r = x", "123", "undefined",
- // Re-initialization of variables other than legacy 'const' is not
- // possible due to sane variable scoping, hence no tests here.
- NULL};
-
static void RunVariableTests(const char* source, const char* tests[]) {
- i::FLAG_legacy_const = true;
EmbeddedVector<char, 512> buffer;
for (int i = 0; tests[i] != NULL; i += 3) {
@@ -99,18 +87,6 @@ TEST(ContextStoreVariables) {
}
-TEST(StackInitializeVariables) {
- const char* source = "(function(a,r) { %s; return r; })";
- RunVariableTests(source, bind_tests);
-}
-
-
-TEST(ContextInitializeVariables) {
- const char* source = "(function(a,r) { %s; function f() {x} return r; })";
- RunVariableTests(source, bind_tests);
-}
-
-
TEST(SelfReferenceVariable) {
FunctionTester T("(function self() { return self; })");
« no previous file with comments | « test/cctest/compiler/test-run-jsops.cc ('k') | test/cctest/interpreter/bytecode_expectations/IllegalRedeclaration.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698