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 5509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5520 CHECK(parser.Parse(&info)); | 5520 CHECK(parser.Parse(&info)); |
5521 CHECK(i::Compiler::Analyze(&info)); | 5521 CHECK(i::Compiler::Analyze(&info)); |
5522 i::FunctionLiteral* func = info.function(); | 5522 i::FunctionLiteral* func = info.function(); |
5523 i::Scope* module_scope = func->scope(); | 5523 i::Scope* module_scope = func->scope(); |
5524 i::Scope* outer_scope = module_scope->outer_scope(); | 5524 i::Scope* outer_scope = module_scope->outer_scope(); |
5525 CHECK(outer_scope->is_script_scope()); | 5525 CHECK(outer_scope->is_script_scope()); |
5526 CHECK_NULL(outer_scope->outer_scope()); | 5526 CHECK_NULL(outer_scope->outer_scope()); |
5527 CHECK_EQ(1, outer_scope->num_modules()); | 5527 CHECK_EQ(1, outer_scope->num_modules()); |
5528 CHECK(module_scope->is_module_scope()); | 5528 CHECK(module_scope->is_module_scope()); |
5529 CHECK_NOT_NULL(module_scope->module_var()); | 5529 CHECK_NOT_NULL(module_scope->module_var()); |
5530 CHECK_EQ(i::INTERNAL, module_scope->module_var()->mode()); | 5530 CHECK_EQ(i::TEMPORARY, module_scope->module_var()->mode()); |
5531 i::ModuleDescriptor* descriptor = module_scope->module(); | 5531 i::ModuleDescriptor* descriptor = module_scope->module(); |
5532 CHECK_NOT_NULL(descriptor); | 5532 CHECK_NOT_NULL(descriptor); |
5533 CHECK_EQ(1, descriptor->Length()); | 5533 CHECK_EQ(1, descriptor->Length()); |
5534 const i::AstRawString* export_name = | 5534 const i::AstRawString* export_name = |
5535 info.ast_value_factory()->GetOneByteString("y"); | 5535 info.ast_value_factory()->GetOneByteString("y"); |
5536 const i::AstRawString* local_name = | 5536 const i::AstRawString* local_name = |
5537 descriptor->LookupLocalExport(export_name, &zone); | 5537 descriptor->LookupLocalExport(export_name, &zone); |
5538 CHECK_NOT_NULL(local_name); | 5538 CHECK_NOT_NULL(local_name); |
5539 CHECK(local_name->IsOneByteEqualTo("x")); | 5539 CHECK(local_name->IsOneByteEqualTo("x")); |
5540 i::ZoneList<i::Declaration*>* declarations = module_scope->declarations(); | 5540 i::ZoneList<i::Declaration*>* declarations = module_scope->declarations(); |
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6838 "for (let x in {}) {}", | 6838 "for (let x in {}) {}", |
6839 "for (let x of []) {}", | 6839 "for (let x of []) {}", |
6840 NULL | 6840 NULL |
6841 }; | 6841 }; |
6842 // clang-format on | 6842 // clang-format on |
6843 | 6843 |
6844 static const ParserFlag always_flags[] = {kAllowHarmonySloppy}; | 6844 static const ParserFlag always_flags[] = {kAllowHarmonySloppy}; |
6845 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, | 6845 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, |
6846 arraysize(always_flags)); | 6846 arraysize(always_flags)); |
6847 } | 6847 } |
OLD | NEW |