Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1015 ParsingModeScope parsing_mode_scope(this, parsing_mode); | 1015 ParsingModeScope parsing_mode_scope(this, parsing_mode); |
| 1016 FunctionState function_state(&function_state_, &scope_state_, scope, | 1016 FunctionState function_state(&function_state_, &scope_state_, scope, |
| 1017 kNormalFunction); | 1017 kNormalFunction); |
| 1018 | 1018 |
| 1019 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone()); | 1019 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone()); |
| 1020 bool ok = true; | 1020 bool ok = true; |
| 1021 int beg_pos = scanner()->location().beg_pos; | 1021 int beg_pos = scanner()->location().beg_pos; |
| 1022 parsing_module_ = info->is_module(); | 1022 parsing_module_ = info->is_module(); |
| 1023 if (parsing_module_) { | 1023 if (parsing_module_) { |
| 1024 ParseModuleItemList(body, &ok); | 1024 ParseModuleItemList(body, &ok); |
| 1025 module()->MakeIndirectExportsExplicit(); | |
|
adamk
2016/08/09 16:52:52
Maybe this should just be called by Validate()? It
neis
2016/08/10 11:53:30
Yeah, I was unsure about this too. I moved it into
| |
| 1025 ok = ok && | 1026 ok = ok && |
| 1026 module()->Validate(this->scope()->AsDeclarationScope(), | 1027 module()->Validate(this->scope()->AsDeclarationScope(), |
| 1027 &pending_error_handler_, zone()); | 1028 &pending_error_handler_, zone()); |
| 1028 } else { | 1029 } else { |
| 1029 // Don't count the mode in the use counters--give the program a chance | 1030 // Don't count the mode in the use counters--give the program a chance |
| 1030 // to enable script-wide strict mode below. | 1031 // to enable script-wide strict mode below. |
| 1031 this->scope()->SetLanguageMode(info->language_mode()); | 1032 this->scope()->SetLanguageMode(info->language_mode()); |
| 1032 ParseStatementList(body, Token::EOS, &ok); | 1033 ParseStatementList(body, Token::EOS, &ok); |
| 1033 } | 1034 } |
| 1034 | 1035 |
| (...skipping 6071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7106 node->Print(Isolate::Current()); | 7107 node->Print(Isolate::Current()); |
| 7107 } | 7108 } |
| 7108 #endif // DEBUG | 7109 #endif // DEBUG |
| 7109 | 7110 |
| 7110 #undef CHECK_OK | 7111 #undef CHECK_OK |
| 7111 #undef CHECK_OK_VOID | 7112 #undef CHECK_OK_VOID |
| 7112 #undef CHECK_FAILED | 7113 #undef CHECK_FAILED |
| 7113 | 7114 |
| 7114 } // namespace internal | 7115 } // namespace internal |
| 7115 } // namespace v8 | 7116 } // namespace v8 |
| OLD | NEW |