function assignBindingElementTypes(node) {
            if (ts.isBindingPattern(node.name)) {
                for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) {
                    var element = _a[_i];
                    if (element.kind !== 187 /* OmittedExpression */) {
                        if (element.name.kind === 69 /* Identifier */) {
                            getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
                        }
                        assignBindingElementTypes(element);
                    }
                }
            }
        }

function
assignBindingElementTypes
(
node
)
{
if
(
ts
.
isBindingPattern
(
node
.
name
)
)
{
for
(
var
_i
=
0
,
_a
=
node
.
name
.
elements
;
_i
<
_a
.
length
;
_i
++
)
{
var
element
=
_a
[
_i
]
;
if
(
element
.
kind
!==
187
/* OmittedExpression */
)
{
if
(
element
.
name
.
kind
===
69
/* Identifier */
)
{
getSymbolLinks
(
getSymbolOfNode
(
element
)
)
.
type
=
getTypeForBindingElement
(
element
)
;
}
assignBindingElementTypes
(
element
)
;
}
}
}
}

When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push the destructured type into the contained binding elements.

When contextual typing assigns a type to a parameter that contains a binding pattern we also need to push the destructured type into the contained binding elements .


function checkTypeParameter(node) {
            // Grammar Checking
            if (node.expression) {
                grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected);
            }
            checkSourceElement(node.constraint);
            if (produceDiagnostics) {
                checkTypeParameterHasIllegalReferencesInConstraint(node);
                checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0);
            }
            // TODO: Check multiple declarations are identical
        }


function getPromisedType(promise) {
            //
            //  { // promise
            //      then( // thenFunction
            //          onfulfilled: ( // onfulfilledParameterType
            //              value: T // valueParameterType
            //          ) => any
            //      ): any;
            //  }
            //
            if (promise.flags & 1 /* Any */) {
                return undefined;
            }
            if ((promise.flags & 4096 /* Reference */) && promise.target === tryGetGlobalPromiseType()) {
                return promise.typeArguments[0];
            }
            var globalPromiseLikeType = getInstantiatedGlobalPromiseLikeType();
            if (globalPromiseLikeType === emptyObjectType || !isTypeAssignableTo(promise, globalPromiseLikeType)) {
                return undefined;
            }
            var thenFunction = getTypeOfPropertyOfType(promise, "then");
            if (thenFunction && (thenFunction.flags & 1 /* Any */)) {
                return undefined;
            }
            var thenSignatures = thenFunction ? getSignaturesOfType(thenFunction, 0 /* Call */) : emptyArray;
            if (thenSignatures.length === 0) {
                return undefined;
            }
            var onfulfilledParameterType = getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature));
            if (onfulfilledParameterType.flags & 1 /* Any */) {
                return undefined;
            }
            var onfulfilledParameterSignatures = getSignaturesOfType(onfulfilledParameterType, 0 /* Call */);
            if (onfulfilledParameterSignatures.length === 0) {
                return undefined;
            }
            var valueParameterType = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature));
            return valueParameterType;
        }

//              value: T // valueParameterType

Gets the "promised type" of a promise.
@param type The type of the promise.
@remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback.


function checkDecorator(node) {
            var signature = getResolvedSignature(node);
            var returnType = getReturnTypeOfSignature(signature);
            if (returnType.flags & 1 /* Any */) {
                return;
            }
            var expectedReturnType;
            var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
            var errorInfo;
            switch (node.parent.kind) {
                case 214 /* ClassDeclaration */:
                    var classSymbol = getSymbolOfNode(node.parent);
                    var classConstructorType = getTypeOfSymbol(classSymbol);
                    expectedReturnType = getUnionType([classConstructorType, voidType]);
                    break;
                case 138 /* Parameter */:
                    expectedReturnType = voidType;
                    errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
                    break;
                case 141 /* PropertyDeclaration */:
                    expectedReturnType = voidType;
                    errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
                    break;
                case 143 /* MethodDeclaration */:
                case 145 /* GetAccessor */:
                case 146 /* SetAccessor */:
                    var methodType = getTypeOfNode(node.parent);
                    var descriptorType = createTypedPropertyDescriptorType(methodType);
                    expectedReturnType = getUnionType([descriptorType, voidType]);
                    break;
            }
            checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo);
        }


function checkTypeNodeAsExpression(node) {
            // When we are emitting type metadata for decorators, we need to try to check the type
            // as if it were an expression so that we can emit the type in a value position when we
            // serialize the type metadata.
            if (node && node.kind === 151 /* TypeReference */) {
                var root = getFirstIdentifier(node.typeName);
                var meaning = root.parent.kind === 151 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */;
                // Resolve type so we know which symbol is referenced
                var rootSymbol = resolveName(root, root.text, meaning | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);
                // Resolved symbol is alias
                if (rootSymbol && rootSymbol.flags & 8388608 /* Alias */) {
                    var aliasTarget = resolveAlias(rootSymbol);
                    // If alias has value symbol - mark alias as referenced
                    if (aliasTarget.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol))) {
                        markAliasSymbolAsReferenced(rootSymbol);
                    }
                }
            }
        }

Checks a type reference node as an expression.

Checks a type reference node as an expression .


function checkTypeAnnotationAsExpression(node) {
            switch (node.kind) {
                case 141 /* PropertyDeclaration */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 138 /* Parameter */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 143 /* MethodDeclaration */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 145 /* GetAccessor */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 146 /* SetAccessor */:
                    checkTypeNodeAsExpression(ts.getSetAccessorTypeAnnotationNode(node));
                    break;
            }
        }

function
checkTypeAnnotationAsExpression
(
node
)
{
switch
(
node
.
kind
)
{
case
141
/* PropertyDeclaration */
:
checkTypeNodeAsExpression
(
node
.
type
)
;
break
;
case
138
/* Parameter */
:
checkTypeNodeAsExpression
(
node
.
type
)
;
break
;
case
143
/* MethodDeclaration */
:
checkTypeNodeAsExpression
(
node
.
type
)
;
break
;
case
145
/* GetAccessor */
:
checkTypeNodeAsExpression
(
node
.
type
)
;
break
;
case
146
/* SetAccessor */
:
checkTypeNodeAsExpression
(
ts
.
getSetAccessorTypeAnnotationNode
(
node
)
)
;
break
;
}
}

Checks the type annotation of an accessor declaration or property declaration as
an expression if it is a type reference to a type with a value declaration.

Checks the type annotation of an accessor declaration or property declaration as an expression if it is a type reference to a type with a value declaration .


function checkDecorators(node) {
            if (!node.decorators) {
                return;
            }
            // skip this check for nodes that cannot have decorators. These should have already had an error reported by
            // checkGrammarDecorators.
            if (!ts.nodeCanBeDecorated(node)) {
                return;
            }
            if (!compilerOptions.experimentalDecorators) {
                error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning);
            }
            if (compilerOptions.emitDecoratorMetadata) {
                // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator.
                switch (node.kind) {
                    case 214 /* ClassDeclaration */:
                        var constructor = ts.getFirstConstructorWithBody(node);
                        if (constructor) {
                            checkParameterTypeAnnotationsAsExpressions(constructor);
                        }
                        break;
                    case 143 /* MethodDeclaration */:
                        checkParameterTypeAnnotationsAsExpressions(node);
                    // fall-through
                    case 146 /* SetAccessor */:
                    case 145 /* GetAccessor */:
                    case 141 /* PropertyDeclaration */:
                    case 138 /* Parameter */:
                        checkTypeAnnotationAsExpression(node);
                        break;
                }
            }
            emitDecorate = true;
            if (node.kind === 138 /* Parameter */) {
                emitParam = true;
            }
            ts.forEach(node.decorators, checkDecorator);
        }


function checkIfThisIsCapturedInEnclosingScope(node) {
            var current = node;
            while (current) {
                if (getNodeCheckFlags(current) & 4 /* CaptureThis */) {
                    var isDeclaration_1 = node.kind !== 69 /* Identifier */;
                    if (isDeclaration_1) {
                        error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference);
                    }
                    else {
                        error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference);
                    }
                    return;
                }
                current = current.parent;
            }
        }

this function will run after checking the source file so 'CaptureThis' is correct for all nodes

this function will run after checking the source file so CaptureThis is correct for all nodes


function checkParameterInitializer(node) {
            if (ts.getRootDeclaration(node).kind !== 138 /* Parameter */) {
                return;
            }
            var func = ts.getContainingFunction(node);
            visit(node.initializer);
            function visit(n) {
                if (n.kind === 69 /* Identifier */) {
                    var referencedSymbol = getNodeLinks(n).resolvedSymbol;
                    // check FunctionLikeDeclaration.locals (stores parameters\function local variable)
                    // if it contains entry with a specified name and if this entry matches the resolved symbol
                    if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) {
                        if (referencedSymbol.valueDeclaration.kind === 138 /* Parameter */) {
                            if (referencedSymbol.valueDeclaration === node) {
                                error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name));
                                return;
                            }
                            if (referencedSymbol.valueDeclaration.pos < node.pos) {
                                // legal case - parameter initializer references some parameter strictly on left of current parameter declaration
                                return;
                            }
                        }
                        error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(node.name), ts.declarationNameToString(n));
                    }
                }
                else {
                    ts.forEachChild(n, visit);
                }
            }
        }

Check that a parameter initializer contains no references to parameters declared to the right of itself


function checkVariableLikeDeclaration(node) {
            checkDecorators(node);
            checkSourceElement(node.type);
            // For a computed property, just check the initializer and exit
            // Do not use hasDynamicName here, because that returns false for well known symbols.
            // We want to perform checkComputedPropertyName for all computed properties, including
            // well known symbols.
            if (node.name.kind === 136 /* ComputedPropertyName */) {
                checkComputedPropertyName(node.name);
                if (node.initializer) {
                    checkExpressionCached(node.initializer);
                }
            }
            // For a binding pattern, check contained binding elements
            if (ts.isBindingPattern(node.name)) {
                ts.forEach(node.name.elements, checkSourceElement);
            }
            // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body
            if (node.initializer && ts.getRootDeclaration(node).kind === 138 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
                error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);
                return;
            }
            // For a binding pattern, validate the initializer and exit
            if (ts.isBindingPattern(node.name)) {
                if (node.initializer) {
                    checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined);
                    checkParameterInitializer(node);
                }
                return;
            }
            var symbol = getSymbolOfNode(node);
            var type = getTypeOfVariableOrParameterOrProperty(symbol);
            if (node === symbol.valueDeclaration) {
                // Node is the primary declaration of the symbol, just validate the initializer
                if (node.initializer) {
                    checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined);
                    checkParameterInitializer(node);
                }
            }
            else {
                // Node is a secondary declaration, check that type is identical to primary declaration and check that
                // initializer is consistent with type associated with the node
                var declarationType = getWidenedTypeForVariableLikeDeclaration(node);
                if (type !== unknownType && declarationType !== unknownType && !isTypeIdenticalTo(type, declarationType)) {
                    error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(node.name), typeToString(type), typeToString(declarationType));
                }
                if (node.initializer) {
                    checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, /*headMessage*/ undefined);
                }
            }
            if (node.kind !== 141 /* PropertyDeclaration */ && node.kind !== 140 /* PropertySignature */) {
                // We know we don't have a binding pattern or computed name here
                checkExportsOnMergedDeclarations(node);
                if (node.kind === 211 /* VariableDeclaration */ || node.kind === 163 /* BindingElement */) {
                    checkVarDeclaredNamesNotShadowed(node);
                }
                checkCollisionWithCapturedSuperVariable(node, node.name);
                checkCollisionWithCapturedThisVariable(node, node.name);
                checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
            }
        }

Check variable, parameter, or property declaration

Check variable parameter or property declaration


function checkElementTypeOfIterable(iterable, errorNode) {
            var elementType = getElementTypeOfIterable(iterable, errorNode);
            // Now even though we have extracted the iteratedType, we will have to validate that the type
            // passed in is actually an Iterable.
            if (errorNode && elementType) {
                checkTypeAssignableTo(iterable, createIterableType(elementType), errorNode);
            }
            return elementType || anyType;
        }

When errorNode is undefined, it means we should not report any errors.

When errorNode is undefined it means we should not report any errors .


function checkTypeParameters(typeParameterDeclarations) {
            if (typeParameterDeclarations) {
                for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) {
                    var node = typeParameterDeclarations[i];
                    checkTypeParameter(node);
                    if (produceDiagnostics) {
                        for (var j = 0; j < i; j++) {
                            if (typeParameterDeclarations[j].symbol === node.symbol) {
                                error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name));
                            }
                        }
                    }
                }
            }
        }

function checkTypeParameters ( typeParameterDeclarations ) { if ( typeParameterDeclarations ) { for ( var i = 0 , n = typeParameterDeclarations . length ; i < n ; i ++ ) { var node = typeParameterDeclarations [ i ] ; checkTypeParameter ( node ) ; if ( produceDiagnostics ) { for ( var j = 0 ; j < i ; j ++ ) { if ( typeParameterDeclarations [ j ] . symbol === node . symbol ) { error ( node . name , ts . Diagnostics . Duplicate_identifier_0 , ts . declarationNameToString ( node . name ) ) ; } } } } } }

Check each type parameter and check that list has no duplicate type parameter declarations


function checkSourceFileWorker(node) {
            var links = getNodeLinks(node);
            if (!(links.flags & 1 /* TypeChecked */)) {
                // Check whether the file has declared it is the default lib,
                // and whether the user has specifically chosen to avoid checking it.
                if (node.isDefaultLib && compilerOptions.skipDefaultLibCheck) {
                    return;
                }
                // Grammar checking
                checkGrammarSourceFile(node);
                emitExtends = false;
                emitDecorate = false;
                emitParam = false;
                potentialThisCollisions.length = 0;
                ts.forEach(node.statements, checkSourceElement);
                checkFunctionAndClassExpressionBodies(node);
                if (ts.isExternalModule(node)) {
                    checkExternalModuleExports(node);
                }
                if (potentialThisCollisions.length) {
                    ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope);
                    potentialThisCollisions.length = 0;
                }
                if (emitExtends) {
                    links.flags |= 8 /* EmitExtends */;
                }
                if (emitDecorate) {
                    links.flags |= 16 /* EmitDecorate */;
                }
                if (emitParam) {
                    links.flags |= 32 /* EmitParam */;
                }
                if (emitAwaiter) {
                    links.flags |= 64 /* EmitAwaiter */;
                }
                if (emitGenerator || (emitAwaiter && languageVersion < 2 /* ES6 */)) {
                    links.flags |= 128 /* EmitGenerator */;
                }
                links.flags |= 1 /* TypeChecked */;
            }
        }

Fully type check a source file and collect the relevant diagnostics.

Fully type check a source file and collect the relevant diagnostics .


function copySymbol(symbol, meaning) {
                if (symbol.flags & meaning) {
                    var id = symbol.name;
                    // We will copy all symbol regardless of its reserved name because
                    // symbolsToArray will check whether the key is a reserved name and
                    // it will not copy symbol with reserved name to the array
                    if (!ts.hasProperty(symbols, id)) {
                        symbols[id] = symbol;
                    }
                }
            }

Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding to symbol table

Copy the given symbol into symbol tables if the symbol has the given meaning and it doesn t already existed in the symbol table


function getParentTypeOfClassElement(node) {
            var classSymbol = getSymbolOfNode(node.parent);
            return node.flags & 128 /* Static */
                ? getTypeOfSymbol(classSymbol)
                : getDeclaredTypeOfSymbol(classSymbol);
        }

function
getParentTypeOfClassElement
(
node
)
{
var
classSymbol
=
getSymbolOfNode
(
node
.
parent
)
;
return
node
.
flags
&
128
/* Static */
getTypeOfSymbol
(
classSymbol
)
:
getDeclaredTypeOfSymbol
(
classSymbol
)
;
}

Gets either the static or instance type of a class element, based on
whether the element is declared as "static".

Gets either the static or instance type of a class element based on whether the element is declared as static .


function getAugmentedPropertiesOfType(type) {
            type = getApparentType(type);
            var propsByName = createSymbolTable(getPropertiesOfType(type));
            if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) {
                ts.forEach(getPropertiesOfType(globalFunctionType), function (p) {
                    if (!ts.hasProperty(propsByName, p.name)) {
                        propsByName[p.name] = p;
                    }
                });
            }
            return getNamedMembers(propsByName);
        }

function
getAugmentedPropertiesOfType
(
type
)
{
type
=
getApparentType
(
type
)
;
var
propsByName
=
createSymbolTable
(
getPropertiesOfType
(
type
)
)
;
if
(
getSignaturesOfType
(
type
,
0
/* Call */
)
.
length
||
getSignaturesOfType
(
type
,
1
/* Construct */
)
.
length
)
{
ts
.
forEach
(
getPropertiesOfType
(
globalFunctionType
)
,
function
(
p
)
{
if
(
!
ts
.
hasProperty
(
propsByName
,
p
.
name
)
)
{
propsByName
[
p
.
name
]
=
p
;
}
}
)
;
}
return
getNamedMembers
(
propsByName
)
;
}

Return the list of properties of the given type, augmented with properties from Function if the type has call or construct signatures

Return the list of properties of the given type augmented with properties from Function if the type has call or construct signatures


function getReferencedExportContainer(node) {
            var symbol = getReferencedValueSymbol(node);
            if (symbol) {
                if (symbol.flags & 1048576 /* ExportValue */) {
                    // If we reference an exported entity within the same module declaration, then whether
                    // we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the
                    // kinds that we do NOT prefix.
                    var exportSymbol = getMergedSymbol(symbol.exportSymbol);
                    if (exportSymbol.flags & 944 /* ExportHasLocal */) {
                        return undefined;
                    }
                    symbol = exportSymbol;
                }
                var parentSymbol = getParentOfSymbol(symbol);
                if (parentSymbol) {
                    if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 248 /* SourceFile */) {
                        return parentSymbol.valueDeclaration;
                    }
                    for (var n = node.parent; n; n = n.parent) {
                        if ((n.kind === 218 /* ModuleDeclaration */ || n.kind === 217 /* EnumDeclaration */) && getSymbolOfNode(n) === parentSymbol) {
                            return n;
                        }
                    }
                }
            }
        }

Emitter support When resolved as an expression identifier, if the given node references an exported entity, return the declaration node of the exported entity's container. Otherwise, return undefined.

Emitter support When resolved as an expression identifier if the given node references an exported entity return the declaration node of the exported entity s container . Otherwise return undefined .


function getReferencedImportDeclaration(node) {
            var symbol = getReferencedValueSymbol(node);
            return symbol && symbol.flags & 8388608 /* Alias */ ? getDeclarationOfAliasSymbol(symbol) : undefined;
        }

function
getReferencedImportDeclaration
(
node
)
{
var
symbol
=
getReferencedValueSymbol
(
node
)
;
return
symbol
&&
symbol
.
flags
&
8388608
/* Alias */
getDeclarationOfAliasSymbol
(
symbol
)
:
undefined
;
}

When resolved as an expression identifier, if the given node references an import, return the declaration of that import. Otherwise, return undefined.

When resolved as an expression identifier if the given node references an import return the declaration of that import . Otherwise return undefined .


function getReferencedNestedRedeclaration(node) {
            var symbol = getReferencedValueSymbol(node);
            return symbol && isNestedRedeclarationSymbol(symbol) ? symbol.valueDeclaration : undefined;
        }

function getReferencedNestedRedeclaration ( node ) { var symbol = getReferencedValueSymbol ( node ) ; return symbol && isNestedRedeclarationSymbol ( symbol ) ? symbol . valueDeclaration : undefined ; }

When resolved as an expression identifier, if the given node references a nested block scoped entity with a name that hides an existing name, return the declaration of that entity. Otherwise, return undefined.

When resolved as an expression identifier if the given node references a nested block scoped entity with a name that hides an existing name return the declaration of that entity . Otherwise return undefined .


function getExportDefaultTempVariableName() {
            var baseName = "_default";
            if (!ts.hasProperty(currentSourceFile.identifiers, baseName)) {
                return baseName;
            }
            var count = 0;
            while (true) {
                var name_18 = baseName + "_" + (++count);
                if (!ts.hasProperty(currentSourceFile.identifiers, name_18)) {
                    return name_18;
                }
            }
        }

function getExportDefaultTempVariableName ( ) { var baseName = "_default" ; if ( ! ts . hasProperty ( currentSourceFile . identifiers , baseName ) ) { return baseName ; } var count = 0 ; while ( true ) { var name_18 = baseName + "_" + ( ++ count ) ; if ( ! ts . hasProperty ( currentSourceFile . identifiers , name_18 ) ) { return name_18 ; } } }

Return a temp variable name to be used in `export default` statements. The temp name will be of the form _default_counter. Note that export default is only allowed at most once in a module, so we do not need to keep track of created temp names.

Return a temp variable name to be used in export default statements . The temp name will be of the form _default_counter . Note that export default is only allowed at most once in a module so we do not need to keep track of created temp names .