|
|
@@ -1368,15 +1368,6 @@ ParseNodePtr Parser::CreateModuleImportDeclNode(IdentPtr localName)
|
|
|
return declNode;
|
|
|
}
|
|
|
|
|
|
-void Parser::MarkIdentifierReferenceIsModuleExport(IdentPtr localName)
|
|
|
-{
|
|
|
- PidRefStack* pidRef = this->PushPidRef(localName);
|
|
|
-
|
|
|
- Assert(pidRef != nullptr);
|
|
|
-
|
|
|
- pidRef->SetModuleExport();
|
|
|
-}
|
|
|
-
|
|
|
ParseNodePtr Parser::CreateVarDeclNode(IdentPtr pid, SymbolType symbolType, bool autoArgumentsObject, ParseNodePtr pnodeFnc, bool errorOnRedecl)
|
|
|
{
|
|
|
ParseNodePtr pnode = CreateDeclNode(knopVarDecl, pid, symbolType, errorOnRedecl);
|
|
|
@@ -1679,6 +1670,11 @@ void Parser::BindPidRefsInScope(IdentPtr pid, Symbol *sym, int blockId, uint max
|
|
|
Js::LocalFunctionId funcId = GetCurrentFunctionNode()->sxFnc.functionId;
|
|
|
Assert(sym);
|
|
|
|
|
|
+ if (pid->GetIsModuleExport())
|
|
|
+ {
|
|
|
+ sym->SetIsModuleExportStorage(true);
|
|
|
+ }
|
|
|
+
|
|
|
for (ref = pid->GetTopRef(); ref && ref->GetScopeId() >= blockId; ref = nextRef)
|
|
|
{
|
|
|
// Fix up sym* on PID ref.
|
|
|
@@ -1702,11 +1698,6 @@ void Parser::BindPidRefsInScope(IdentPtr pid, Symbol *sym, int blockId, uint max
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (ref->IsModuleExport())
|
|
|
- {
|
|
|
- sym->SetIsModuleExportStorage(true);
|
|
|
- }
|
|
|
-
|
|
|
if (ref->GetFuncScopeId() != funcId && !sym->GetIsGlobal() && !sym->GetIsModuleExportStorage())
|
|
|
{
|
|
|
Assert(ref->GetFuncScopeId() > funcId);
|
|
|
@@ -2142,7 +2133,7 @@ void Parser::ParseNamedImportOrExportClause(ModuleImportOrExportEntryList* impor
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MarkIdentifierReferenceIsModuleExport(identifierName);
|
|
|
+ identifierName->SetIsModuleExport();
|
|
|
AddModuleImportOrExportEntry(importOrExportEntryList, nullptr, identifierName, identifierAs, nullptr);
|
|
|
}
|
|
|
}
|