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

Unified Diff: test/cctest/test-decls.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-interpreter.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-decls.cc
diff --git a/test/cctest/test-decls.cc b/test/cctest/test-decls.cc
index 4e9595258a1b33cd3556b9ed1ac4364a8306a0d1..35cb515dc100f7357e6047056b7870b7128054d8 100644
--- a/test/cctest/test-decls.cc
+++ b/test/cctest/test-decls.cc
@@ -227,7 +227,6 @@ v8::Local<Integer> DeclarationContext::Query(Local<Name> key) {
// Test global declaration of a property the interceptor doesn't know
// about and doesn't handle.
TEST(Unknown) {
- i::FLAG_legacy_const = true;
HandleScope scope(CcTest::isolate());
v8::V8::Initialize();
@@ -251,20 +250,6 @@ TEST(Unknown) {
0,
EXPECT_RESULT);
}
-
- { DeclarationContext context;
- context.Check("const x; x",
- 1, // access
- 0, 0, EXPECT_RESULT, Undefined(CcTest::isolate()));
- }
-
- { DeclarationContext context;
- context.Check("const x = 0; x",
- 1, // access
- 0,
- 0,
- EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
- }
}
@@ -277,7 +262,6 @@ class AbsentPropertyContext: public DeclarationContext {
TEST(Absent) {
- i::FLAG_legacy_const = true;
v8::Isolate* isolate = CcTest::isolate();
v8::V8::Initialize();
HandleScope scope(isolate);
@@ -304,18 +288,6 @@ TEST(Absent) {
}
{ AbsentPropertyContext context;
- context.Check("const x; x",
- 1, // access
- 0, 0, EXPECT_RESULT, Undefined(isolate));
- }
-
- { AbsentPropertyContext context;
- context.Check("const x = 0; x",
- 1, // access
- 0, 0, EXPECT_RESULT, Number::New(isolate, 0));
- }
-
- { AbsentPropertyContext context;
context.Check("if (false) { var x = 0 }; x",
1, // access
0, 0, EXPECT_RESULT, Undefined(isolate));
@@ -361,7 +333,6 @@ class AppearingPropertyContext: public DeclarationContext {
TEST(Appearing) {
- i::FLAG_legacy_const = true;
v8::V8::Initialize();
HandleScope scope(CcTest::isolate());
@@ -385,18 +356,6 @@ TEST(Appearing) {
0,
EXPECT_RESULT);
}
-
- { AppearingPropertyContext context;
- context.Check("const x; x",
- 1, // access
- 0, 0, EXPECT_RESULT, Undefined(CcTest::isolate()));
- }
-
- { AppearingPropertyContext context;
- context.Check("const x = 0; x",
- 1, // access
- 0, 0, EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
- }
}
@@ -418,7 +377,6 @@ class ExistsInPrototypeContext: public DeclarationContext {
TEST(ExistsInPrototype) {
- i::FLAG_legacy_const = true;
HandleScope scope(CcTest::isolate());
// Sanity check to make sure that the holder of the interceptor
@@ -443,22 +401,6 @@ TEST(ExistsInPrototype) {
0,
EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
}
-
- { ExistsInPrototypeContext context;
- context.Check("const x; x",
- 0,
- 0,
- 0,
- EXPECT_RESULT, Undefined(CcTest::isolate()));
- }
-
- { ExistsInPrototypeContext context;
- context.Check("const x = 0; x",
- 0,
- 0,
- 0,
- EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
- }
}
@@ -528,7 +470,6 @@ class ExistsInHiddenPrototypeContext: public DeclarationContext {
TEST(ExistsInHiddenPrototype) {
- i::FLAG_legacy_const = true;
HandleScope scope(CcTest::isolate());
{ ExistsInHiddenPrototypeContext context;
@@ -548,18 +489,6 @@ TEST(ExistsInHiddenPrototype) {
0,
EXPECT_RESULT);
}
-
- // TODO(mstarzinger): The semantics of global const is vague.
- { ExistsInHiddenPrototypeContext context;
- context.Check("const x; x", 0, 0, 0, EXPECT_RESULT,
- Undefined(CcTest::isolate()));
- }
-
- // TODO(mstarzinger): The semantics of global const is vague.
- { ExistsInHiddenPrototypeContext context;
- context.Check("const x = 0; x", 0, 0, 0, EXPECT_RESULT,
- Number::New(CcTest::isolate(), 0));
- }
}
@@ -612,7 +541,6 @@ class SimpleContext {
TEST(CrossScriptReferences) {
- i::FLAG_legacy_const = true;
v8::Isolate* isolate = CcTest::isolate();
HandleScope scope(isolate);
@@ -621,8 +549,6 @@ TEST(CrossScriptReferences) {
EXPECT_RESULT, Number::New(isolate, 1));
context.Check("var x = 2; x",
EXPECT_RESULT, Number::New(isolate, 2));
- context.Check("const x = 3; x", EXPECT_EXCEPTION);
- context.Check("const x = 4; x", EXPECT_EXCEPTION);
context.Check("x = 5; x",
EXPECT_RESULT, Number::New(isolate, 5));
context.Check("var x = 6; x",
@@ -632,22 +558,6 @@ TEST(CrossScriptReferences) {
context.Check("function x() { return 7 }; x()",
EXPECT_RESULT, Number::New(isolate, 7));
}
-
- { SimpleContext context;
- context.Check("const x = 1; x",
- EXPECT_RESULT, Number::New(isolate, 1));
- context.Check("var x = 2; x", // assignment ignored
- EXPECT_RESULT, Number::New(isolate, 1));
- context.Check("const x = 3; x", EXPECT_EXCEPTION);
- context.Check("x = 4; x", // assignment ignored
- EXPECT_RESULT, Number::New(isolate, 1));
- context.Check("var x = 5; x", // assignment ignored
- EXPECT_RESULT, Number::New(isolate, 1));
- context.Check("this.x",
- EXPECT_RESULT, Number::New(isolate, 1));
- context.Check("function x() { return 7 }; x",
- EXPECT_EXCEPTION);
- }
}
« no previous file with comments | « test/cctest/interpreter/test-interpreter.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698