| Index: test/cctest/test-parsing.cc
|
| diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
|
| index 00d200a6c85a533b7119f61bdc56f7ea0292969c..c2bde79b13b28a4333c95f781b3eeb4fd27a5d6f 100755
|
| --- a/test/cctest/test-parsing.cc
|
| +++ b/test/cctest/test-parsing.cc
|
| @@ -758,76 +758,82 @@ TEST(ScopePositions) {
|
| const char* inner_source;
|
| const char* outer_suffix;
|
| i::ScopeType scope_type;
|
| + i::LanguageMode language_mode;
|
| };
|
|
|
| const SourceData source_data[] = {
|
| - { " with ({}) ", "{ block; }", " more;", i::WITH_SCOPE },
|
| - { " with ({}) ", "{ block; }", "; more;", i::WITH_SCOPE },
|
| + { " with ({}) ", "{ block; }", " more;", i::WITH_SCOPE, i::CLASSIC_MODE },
|
| + { " with ({}) ", "{ block; }", "; more;", i::WITH_SCOPE, i::CLASSIC_MODE },
|
| { " with ({}) ", "{\n"
|
| " block;\n"
|
| " }", "\n"
|
| - " more;", i::WITH_SCOPE },
|
| - { " with ({}) ", "statement;", " more;", i::WITH_SCOPE },
|
| + " more;", i::WITH_SCOPE, i::CLASSIC_MODE },
|
| + { " with ({}) ", "statement;", " more;", i::WITH_SCOPE, i::CLASSIC_MODE },
|
| { " with ({}) ", "statement", "\n"
|
| - " more;", i::WITH_SCOPE },
|
| + " more;", i::WITH_SCOPE, i::CLASSIC_MODE },
|
| { " with ({})\n"
|
| " ", "statement;", "\n"
|
| - " more;", i::WITH_SCOPE },
|
| - { " try {} catch ", "(e) { block; }", " more;", i::CATCH_SCOPE },
|
| - { " try {} catch ", "(e) { block; }", "; more;", i::CATCH_SCOPE },
|
| + " more;", i::WITH_SCOPE, i::CLASSIC_MODE },
|
| + { " try {} catch ", "(e) { block; }", " more;",
|
| + i::CATCH_SCOPE, i::CLASSIC_MODE },
|
| + { " try {} catch ", "(e) { block; }", "; more;",
|
| + i::CATCH_SCOPE, i::CLASSIC_MODE },
|
| { " try {} catch ", "(e) {\n"
|
| " block;\n"
|
| " }", "\n"
|
| - " more;", i::CATCH_SCOPE },
|
| + " more;", i::CATCH_SCOPE, i::CLASSIC_MODE },
|
| { " try {} catch ", "(e) { block; }", " finally { block; } more;",
|
| - i::CATCH_SCOPE },
|
| + i::CATCH_SCOPE, i::CLASSIC_MODE },
|
| { " start;\n"
|
| - " ", "{ let block; }", " more;", i::BLOCK_SCOPE },
|
| + " ", "{ let block; }", " more;", i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " start;\n"
|
| - " ", "{ let block; }", "; more;", i::BLOCK_SCOPE },
|
| + " ", "{ let block; }", "; more;", i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " start;\n"
|
| " ", "{\n"
|
| " let block;\n"
|
| " }", "\n"
|
| - " more;", i::BLOCK_SCOPE },
|
| + " more;", i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " start;\n"
|
| " function fun", "(a,b) { infunction; }", " more;",
|
| - i::FUNCTION_SCOPE },
|
| + i::FUNCTION_SCOPE, i::CLASSIC_MODE },
|
| { " start;\n"
|
| " function fun", "(a,b) {\n"
|
| " infunction;\n"
|
| " }", "\n"
|
| - " more;", i::FUNCTION_SCOPE },
|
| + " more;", i::FUNCTION_SCOPE, i::CLASSIC_MODE },
|
| { " (function fun", "(a,b) { infunction; }", ")();",
|
| - i::FUNCTION_SCOPE },
|
| + i::FUNCTION_SCOPE, i::CLASSIC_MODE },
|
| { " for ", "(let x = 1 ; x < 10; ++ x) { block; }", " more;",
|
| - i::BLOCK_SCOPE },
|
| + i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " for ", "(let x = 1 ; x < 10; ++ x) { block; }", "; more;",
|
| - i::BLOCK_SCOPE },
|
| + i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " for ", "(let x = 1 ; x < 10; ++ x) {\n"
|
| " block;\n"
|
| " }", "\n"
|
| - " more;", i::BLOCK_SCOPE },
|
| + " more;", i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " for ", "(let x = 1 ; x < 10; ++ x) statement;", " more;",
|
| - i::BLOCK_SCOPE },
|
| + i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " for ", "(let x = 1 ; x < 10; ++ x) statement", "\n"
|
| - " more;", i::BLOCK_SCOPE },
|
| + " more;", i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " for ", "(let x = 1 ; x < 10; ++ x)\n"
|
| " statement;", "\n"
|
| - " more;", i::BLOCK_SCOPE },
|
| - { " for ", "(let x in {}) { block; }", " more;", i::BLOCK_SCOPE },
|
| - { " for ", "(let x in {}) { block; }", "; more;", i::BLOCK_SCOPE },
|
| + " more;", i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| + { " for ", "(let x in {}) { block; }", " more;",
|
| + i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| + { " for ", "(let x in {}) { block; }", "; more;",
|
| + i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " for ", "(let x in {}) {\n"
|
| " block;\n"
|
| " }", "\n"
|
| - " more;", i::BLOCK_SCOPE },
|
| - { " for ", "(let x in {}) statement;", " more;", i::BLOCK_SCOPE },
|
| + " more;", i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| + { " for ", "(let x in {}) statement;", " more;",
|
| + i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " for ", "(let x in {}) statement", "\n"
|
| - " more;", i::BLOCK_SCOPE },
|
| + " more;", i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| { " for ", "(let x in {})\n"
|
| " statement;", "\n"
|
| - " more;", i::BLOCK_SCOPE },
|
| - { NULL, NULL, NULL, i::EVAL_SCOPE }
|
| + " more;", i::BLOCK_SCOPE, i::EXTENDED_MODE },
|
| + { NULL, NULL, NULL, i::EVAL_SCOPE, i::CLASSIC_MODE }
|
| };
|
|
|
| v8::HandleScope handles;
|
| @@ -857,7 +863,7 @@ TEST(ScopePositions) {
|
| i::Parser parser(script, false, NULL, NULL);
|
| parser.SetHarmonyScoping(true);
|
| i::FunctionLiteral* function =
|
| - parser.ParseProgram(source, true, i::kNonStrictMode);
|
| + parser.ParseProgram(source, true, source_data[i].language_mode);
|
| ASSERT(function != NULL);
|
|
|
| // Check scope types and positions.
|
|
|