From fab6fca5b4af8685ace4496a02db8eb312662605 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Sun, 19 Apr 2015 16:48:28 -0700 Subject: [PATCH] Remove post bind step for modules. --- src/compiler/binder.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 3d9204c81a9..d214cba6140 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -409,17 +409,9 @@ module ts { return declareSymbolAndAddToSymbolTable(node, SymbolFlags.NamespaceModule, SymbolFlags.NamespaceModuleExcludes); } else { - return declareSymbolAndAddToSymbolTable(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes); - } - } - } + let result = declareSymbolAndAddToSymbolTable(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes); - function postBindModuleDeclarationChildren(node: ModuleDeclaration) { - if (node.name.kind !== SyntaxKind.StringLiteral) { - let state = getModuleInstanceState(node); - if (state !== ModuleInstanceState.NonInstantiated) { let currentModuleIsConstEnumOnly = state === ModuleInstanceState.ConstEnumOnly; - if (node.symbol.constEnumOnlyModule === undefined) { // non-merged case - use the current state node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; @@ -428,6 +420,8 @@ module ts { // merged case: module is const enum only if all its pieces are non-instantiated or const enum node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; } + + return result; } } } @@ -600,8 +594,6 @@ module ts { function postBindChildren(node: Node) { switch (node.kind) { - case SyntaxKind.ModuleDeclaration: - return postBindModuleDeclarationChildren(node); case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: return postBindFunctionOrConstructorTypeChildren(node);