demo/typescript.js
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);
                    }
                }
            }
        }
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);
                    }
                }
            }
        }
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 .