Changeset 188417 in webkit for trunk/Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp
- Timestamp:
- Aug 13, 2015, 4:55:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp
r188355 r188417 41 41 { 42 42 // In the module analyzer phase, only module declarations are included in the top-level SourceElements. 43 for (StatementNode* statement = m_head; statement; statement = statement->next()) 43 for (StatementNode* statement = m_head; statement; statement = statement->next()) { 44 ASSERT(statement->isModuleDeclarationNode()); 44 45 static_cast<ModuleDeclarationNode*>(statement)->analyzeModule(analyzer); 46 } 45 47 } 46 48 47 49 void ImportDeclarationNode::analyzeModule(ModuleAnalyzer& analyzer) 48 50 { 49 analyzer.moduleRecord().appendRequestedModule(m_module Specifier->moduleName());51 analyzer.moduleRecord().appendRequestedModule(m_moduleName->moduleName()); 50 52 for (auto* specifier : m_specifierList->specifiers()) { 51 analyzer.moduleRecord().addImportEntry( {52 m_module Specifier->moduleName(),53 analyzer.moduleRecord().addImportEntry(ModuleRecord::ImportEntry { 54 m_moduleName->moduleName(), 53 55 specifier->importedName(), 54 56 specifier->localName() … … 59 61 void ExportAllDeclarationNode::analyzeModule(ModuleAnalyzer& analyzer) 60 62 { 61 analyzer.moduleRecord().appendRequestedModule(m_module Specifier->moduleName());62 analyzer.moduleRecord().addStarExportEntry(m_module Specifier->moduleName());63 analyzer.moduleRecord().appendRequestedModule(m_moduleName->moduleName()); 64 analyzer.moduleRecord().addStarExportEntry(m_moduleName->moduleName()); 63 65 } 64 66 … … 74 76 void ExportNamedDeclarationNode::analyzeModule(ModuleAnalyzer& analyzer) 75 77 { 76 if (m_module Specifier)77 analyzer.moduleRecord().appendRequestedModule(m_module Specifier->moduleName());78 if (m_moduleName) 79 analyzer.moduleRecord().appendRequestedModule(m_moduleName->moduleName()); 78 80 79 81 for (auto* specifier : m_specifierList->specifiers()) { 80 if (m_module Specifier) {82 if (m_moduleName) { 81 83 // export { v } from "mod" 82 84 // 83 85 // In this case, no local variable names are imported into the current module. 84 86 // "v" indirectly points the binding in "mod". 85 analyzer.moduleRecord().addExportEntry(ModuleRecord::ExportEntry::createIndirect(specifier->exportedName(), specifier->localName(), m_module Specifier->moduleName()));87 analyzer.moduleRecord().addExportEntry(ModuleRecord::ExportEntry::createIndirect(specifier->exportedName(), specifier->localName(), m_moduleName->moduleName())); 86 88 continue; 87 89 }
Note:
See TracChangeset
for help on using the changeset viewer.