@angular/tsc-wrapped
Advanced tools
Comparing version 4.4.3 to 4.4.4
{ | ||
"name": "@angular/tsc-wrapped", | ||
"version": "4.4.3", | ||
"version": "4.4.4", | ||
"description": "Wraps the tsc CLI, allowing extensions.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/angular/angular/blob/master/tools/@angular/tsc-wrapped", |
@@ -328,2 +328,13 @@ "use strict"; | ||
break; | ||
case ts.SyntaxKind.TypeAliasDeclaration: | ||
var typeDeclaration = node; | ||
if (typeDeclaration.name && isExported(typeDeclaration)) { | ||
var name_4 = exportedName(typeDeclaration); | ||
if (name_4) { | ||
if (!metadata) | ||
metadata = {}; | ||
metadata[name_4] = { __symbolic: 'interface' }; | ||
} | ||
} | ||
break; | ||
case ts.SyntaxKind.InterfaceDeclaration: | ||
@@ -344,5 +355,5 @@ var interfaceDeclaration = node; | ||
metadata = {}; | ||
var name_4 = exportedName(functionDeclaration); | ||
var name_5 = exportedName(functionDeclaration); | ||
var maybeFunc = maybeGetSimpleFunction(functionDeclaration); | ||
metadata[name_4] = | ||
metadata[name_5] = | ||
maybeFunc ? recordEntry(maybeFunc.func, node) : { __symbolic: 'function' }; | ||
@@ -367,7 +378,7 @@ } | ||
} | ||
var name_5 = undefined; | ||
var name_6 = undefined; | ||
if (member.name.kind == ts.SyntaxKind.Identifier) { | ||
var identifier = member.name; | ||
name_5 = identifier.text; | ||
enumValueHolder[name_5] = enumValue; | ||
name_6 = identifier.text; | ||
enumValueHolder[name_6] = enumValue; | ||
writtenMembers++; | ||
@@ -378,3 +389,3 @@ } | ||
} | ||
else if (name_5) { | ||
else if (name_6) { | ||
nextDefaultValue = { | ||
@@ -385,3 +396,3 @@ __symbolic: 'binary', | ||
__symbolic: 'select', | ||
expression: recordEntry({ __symbolic: 'reference', name: enumName }, node), name: name_5 | ||
expression: recordEntry({ __symbolic: 'reference', name: enumName }, node), name: name_6 | ||
} | ||
@@ -447,9 +458,9 @@ }; | ||
case ts.SyntaxKind.Identifier: | ||
var name_6 = nameNode; | ||
var varValue = errorSym('Destructuring not supported', name_6); | ||
locals.define(name_6.text, varValue); | ||
var name_7 = nameNode; | ||
var varValue = errorSym('Destructuring not supported', name_7); | ||
locals.define(name_7.text, varValue); | ||
if (isExport(node)) { | ||
if (!metadata) | ||
metadata = {}; | ||
metadata[name_6.text] = varValue; | ||
metadata[name_7.text] = varValue; | ||
} | ||
@@ -656,5 +667,5 @@ break; | ||
var element = _a[_i]; | ||
var name_7 = element.name; | ||
if (name_7) { | ||
addNamesOf(name_7); | ||
var name_8 = element.name; | ||
if (name_8) { | ||
addNamesOf(name_8); | ||
} | ||
@@ -661,0 +672,0 @@ } |
@@ -36,2 +36,3 @@ "use strict"; | ||
'exported-consts.ts', | ||
'exported-type.ts', | ||
'local-symbol-ref.ts', | ||
@@ -65,2 +66,7 @@ 'local-function-ref.ts', | ||
}); | ||
it('should return an interface reference for types', function () { | ||
var sourceFile = program.getSourceFile('/exported-type.ts'); | ||
var metadata = collector.getMetadata(sourceFile); | ||
expect(metadata).toEqual({ __symbolic: 'module', version: 3, metadata: { SomeType: { __symbolic: 'interface' } } }); | ||
}); | ||
it('should return an interface reference for interfaces', function () { | ||
@@ -832,2 +838,3 @@ var sourceFile = program.getSourceFile('app/hero.ts'); | ||
'exported-functions.ts': "\n export function one(a: string, b: string, c: string) {\n return {a: a, b: b, c: c};\n }\n export function two(a: string, b: string, c: string) {\n return {a, b, c};\n }\n export function three({a, b, c}: {a: string, b: string, c: string}) {\n return [a, b, c];\n }\n export function supportsState(): boolean {\n return !!window.history.pushState;\n }\n export function complexFn(x: any): boolean {\n if (x) {\n return true;\n } else {\n return false;\n }\n }\n export declare function declaredFn();\n ", | ||
'exported-type.ts': "\n export type SomeType = 'a' | 'b';\n ", | ||
'exported-enum.ts': "\n import {constValue} from './exported-consts';\n\n export const someValue = 30;\n export enum SomeEnum { A, B, C = 100, D };\n export enum ComplexEnum { A, B, C = someValue, D = someValue + 10, E = constValue };\n ", | ||
@@ -834,0 +841,0 @@ 'exported-consts.ts': "\n export const constValue = 100;\n ", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
676713
5334