| Index: test/cctest/compiler/test-run-bytecode-graph-builder.cc
|
| diff --git a/test/cctest/compiler/test-run-bytecode-graph-builder.cc b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
|
| index 9a038221a18d36b98a4f27418a2ddfa85e286bad..059460e0a8bc2f415cb4dd160fc3f848f678189c 100644
|
| --- a/test/cctest/compiler/test-run-bytecode-graph-builder.cc
|
| +++ b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
|
| @@ -2835,29 +2835,6 @@ TEST(BytecodeGraphBuilderConstInLookupContextChain) {
|
| Handle<Object> return_value = callable().ToHandleChecked();
|
| CHECK(return_value->SameValue(*const_decl[i].return_value()));
|
| }
|
| -
|
| - // Tests for Legacy constant.
|
| - bool old_flag_legacy_const = FLAG_legacy_const;
|
| - FLAG_legacy_const = true;
|
| -
|
| - ExpectedSnippet<0> 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++) {
|
| - ScopedVector<char> script(1024);
|
| - SNPrintF(script, "%s %s %s", prologue, legacy_const_decl[i].code_snippet,
|
| - epilogue);
|
| -
|
| - BytecodeGraphTester tester(isolate, zone, script.start(), "*");
|
| - auto callable = tester.GetCallable<>();
|
| - Handle<Object> return_value = callable().ToHandleChecked();
|
| - CHECK(return_value->SameValue(*legacy_const_decl[i].return_value()));
|
| - }
|
| -
|
| - FLAG_legacy_const = old_flag_legacy_const;
|
| }
|
|
|
| TEST(BytecodeGraphBuilderIllegalConstDeclaration) {
|
| @@ -2911,43 +2888,6 @@ TEST(BytecodeGraphBuilderIllegalConstDeclaration) {
|
| }
|
| }
|
|
|
| -TEST(BytecodeGraphBuilderLegacyConstDeclaration) {
|
| - bool old_flag_legacy_const = FLAG_legacy_const;
|
| - FLAG_legacy_const = true;
|
| -
|
| - HandleAndZoneScope scope;
|
| - Isolate* isolate = scope.main_isolate();
|
| - Zone* zone = scope.main_zone();
|
| -
|
| - ExpectedSnippet<0> snippets[] = {
|
| - {"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(snippets); i++) {
|
| - ScopedVector<char> script(1024);
|
| - SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
|
| - snippets[i].code_snippet, kFunctionName);
|
| -
|
| - BytecodeGraphTester tester(isolate, zone, script.start());
|
| - auto callable = tester.GetCallable<>();
|
| - Handle<Object> return_value = callable().ToHandleChecked();
|
| - CHECK(return_value->SameValue(*snippets[i].return_value()));
|
| - }
|
| -
|
| - FLAG_legacy_const = old_flag_legacy_const;
|
| -}
|
| -
|
| TEST(BytecodeGraphBuilderDebuggerStatement) {
|
| FLAG_expose_debug_as = "debug";
|
| HandleAndZoneScope scope;
|
|
|