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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 *ok = false; | 1553 *ok = false; |
1554 ReportUnexpectedToken(scanner()->current_token()); | 1554 ReportUnexpectedToken(scanner()->current_token()); |
1555 return NULL; | 1555 return NULL; |
1556 } | 1556 } |
1557 } | 1557 } |
1558 | 1558 |
1559 ExpectContextualKeyword(CStrVector("from"), CHECK_OK); | 1559 ExpectContextualKeyword(CStrVector("from"), CHECK_OK); |
1560 const AstRawString* module_specifier = ParseModuleSpecifier(CHECK_OK); | 1560 const AstRawString* module_specifier = ParseModuleSpecifier(CHECK_OK); |
1561 ExpectSemicolon(CHECK_OK); | 1561 ExpectSemicolon(CHECK_OK); |
1562 | 1562 |
| 1563 scope_->module()->AddModuleRequest(module_specifier, zone()); |
| 1564 |
1563 if (module_instance_binding != NULL) { | 1565 if (module_instance_binding != NULL) { |
1564 // TODO(ES6): Set the module specifier for the module namespace binding. | 1566 // TODO(ES6): Set the module specifier for the module namespace binding. |
1565 } | 1567 } |
1566 | 1568 |
1567 if (import_default_declaration != NULL) { | 1569 if (import_default_declaration != NULL) { |
1568 import_default_declaration->set_module_specifier(module_specifier); | 1570 import_default_declaration->set_module_specifier(module_specifier); |
1569 } | 1571 } |
1570 | 1572 |
1571 if (named_declarations != NULL) { | 1573 if (named_declarations != NULL) { |
1572 for (int i = 0; i < named_declarations->length(); ++i) { | 1574 for (int i = 0; i < named_declarations->length(); ++i) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 for (int i = 0; i < length; ++i) { | 1692 for (int i = 0; i < length; ++i) { |
1691 scope_->module()->AddLocalExport(export_names[i], local_names[i], | 1693 scope_->module()->AddLocalExport(export_names[i], local_names[i], |
1692 zone(), ok); | 1694 zone(), ok); |
1693 if (!*ok) { | 1695 if (!*ok) { |
1694 ParserTraits::ReportMessageAt(export_locations[i], | 1696 ParserTraits::ReportMessageAt(export_locations[i], |
1695 "duplicate_export", export_names[i]); | 1697 "duplicate_export", export_names[i]); |
1696 return NULL; | 1698 return NULL; |
1697 } | 1699 } |
1698 } | 1700 } |
1699 } else { | 1701 } else { |
| 1702 scope_->module()->AddModuleRequest(indirect_export_module_specifier, |
| 1703 zone()); |
1700 for (int i = 0; i < length; ++i) { | 1704 for (int i = 0; i < length; ++i) { |
1701 // TODO(ES6): scope_->module()->AddIndirectExport(...);( | 1705 // TODO(ES6): scope_->module()->AddIndirectExport(...);( |
1702 } | 1706 } |
1703 } | 1707 } |
1704 return factory()->NewEmptyStatement(pos); | 1708 return factory()->NewEmptyStatement(pos); |
1705 } | 1709 } |
1706 | 1710 |
1707 case Token::FUNCTION: | 1711 case Token::FUNCTION: |
1708 result = ParseFunctionDeclaration(&names, CHECK_OK); | 1712 result = ParseFunctionDeclaration(&names, CHECK_OK); |
1709 break; | 1713 break; |
(...skipping 4021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5731 | 5735 |
5732 Expression* Parser::SpreadCallNew(Expression* function, | 5736 Expression* Parser::SpreadCallNew(Expression* function, |
5733 ZoneList<v8::internal::Expression*>* args, | 5737 ZoneList<v8::internal::Expression*>* args, |
5734 int pos) { | 5738 int pos) { |
5735 args->InsertAt(0, function, zone()); | 5739 args->InsertAt(0, function, zone()); |
5736 | 5740 |
5737 return factory()->NewCallRuntime( | 5741 return factory()->NewCallRuntime( |
5738 ast_value_factory()->reflect_construct_string(), NULL, args, pos); | 5742 ast_value_factory()->reflect_construct_string(), NULL, args, pos); |
5739 } | 5743 } |
5740 } } // namespace v8::internal | 5744 } } // namespace v8::internal |
OLD | NEW |