Changeset 267186 in webkit for trunk/Source/JavaScriptCore/parser/Parser.cpp
- Timestamp:
- Sep 17, 2020, 3:30:19 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/Parser.cpp
r266340 r267186 3532 3532 case TIMES: { 3533 3533 // export * FromClause ; 3534 next(); 3534 // export * as IdentifierName FromClause ; 3535 next(); 3536 3537 const Identifier* exportedName = nullptr; 3538 JSTokenLocation specifierLocation; 3539 if (matchContextualKeyword(m_vm.propertyNames->as)) { 3540 next(); 3541 specifierLocation = JSTokenLocation(tokenLocation()); 3542 failIfFalse(matchIdentifierOrKeyword(), "Expected an exported name for the export declaration"); 3543 exportedName = m_token.m_data.ident; 3544 next(); 3545 } 3535 3546 3536 3547 failIfFalse(matchContextualKeyword(m_vm.propertyNames->from), "Expected 'from' before exported module name"); … … 3539 3550 failIfFalse(moduleName, "Cannot parse the 'from' clause"); 3540 3551 failIfFalse(autoSemiColon(), "Expected a ';' following a targeted export declaration"); 3552 3553 if (exportedName) { 3554 semanticFailIfFalse(exportName(*exportedName), "Cannot export a duplicate name '", exportedName->impl(), "'"); 3555 auto specifierList = context.createExportSpecifierList(); 3556 auto localName = &m_vm.propertyNames->starNamespacePrivateName; 3557 auto specifier = context.createExportSpecifier(specifierLocation, *localName, *exportedName); 3558 context.appendExportSpecifier(specifierList, specifier); 3559 return context.createExportNamedDeclaration(exportLocation, specifierList, moduleName); 3560 } 3541 3561 3542 3562 return context.createExportAllDeclaration(exportLocation, moduleName);
Note:
See TracChangeset
for help on using the changeset viewer.