OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 i::Handle<i::String> source = | 1039 i::Handle<i::String> source = |
1040 factory->NewStringFromUtf8(i::CStrVector(program.start())) | 1040 factory->NewStringFromUtf8(i::CStrVector(program.start())) |
1041 .ToHandleChecked(); | 1041 .ToHandleChecked(); |
1042 i::Handle<i::Script> script = factory->NewScript(source); | 1042 i::Handle<i::Script> script = factory->NewScript(source); |
1043 i::Zone zone(CcTest::i_isolate()->allocator()); | 1043 i::Zone zone(CcTest::i_isolate()->allocator()); |
1044 i::ParseInfo info(&zone, script); | 1044 i::ParseInfo info(&zone, script); |
1045 i::Parser parser(&info); | 1045 i::Parser parser(&info); |
1046 info.set_global(); | 1046 info.set_global(); |
1047 CHECK(parser.Parse(&info)); | 1047 CHECK(parser.Parse(&info)); |
1048 CHECK(i::Rewriter::Rewrite(&info)); | 1048 CHECK(i::Rewriter::Rewrite(&info)); |
1049 i::DeclarationScope::Analyze(&info); | 1049 i::DeclarationScope::Analyze(&info, i::AnalyzeMode::kRegular); |
1050 CHECK(info.literal() != NULL); | 1050 CHECK(info.literal() != NULL); |
1051 | 1051 |
1052 i::DeclarationScope* script_scope = info.literal()->scope(); | 1052 i::DeclarationScope* script_scope = info.literal()->scope(); |
1053 CHECK(script_scope->is_script_scope()); | 1053 CHECK(script_scope->is_script_scope()); |
1054 | 1054 |
1055 i::Scope* scope = script_scope->inner_scope(); | 1055 i::Scope* scope = script_scope->inner_scope(); |
1056 DCHECK_NOT_NULL(scope); | 1056 DCHECK_NOT_NULL(scope); |
1057 DCHECK_NULL(scope->sibling()); | 1057 DCHECK_NULL(scope->sibling()); |
1058 // Adjust for constructor scope. | 1058 // Adjust for constructor scope. |
1059 if (j == 2) { | 1059 if (j == 2) { |
(...skipping 7119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8179 "(a,);", | 8179 "(a,);", |
8180 "(a,b,c,);", | 8180 "(a,b,c,);", |
8181 NULL | 8181 NULL |
8182 }; | 8182 }; |
8183 // clang-format on | 8183 // clang-format on |
8184 | 8184 |
8185 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; | 8185 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; |
8186 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, | 8186 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
8187 arraysize(always_flags)); | 8187 arraysize(always_flags)); |
8188 } | 8188 } |
OLD | NEW |