@angular/compiler-cli 5.2.0-rc.0 → 5.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/metadata/collector.js +2 -2
- package/src/metadata/collector.js.map +1 -1
- package/src/metadata/evaluator.js +0 -3
- package/src/metadata/evaluator.js.map +1 -1
- package/src/transformers/api.js.map +1 -1
- package/src/transformers/compiler_host.d.ts +1 -0
- package/src/transformers/compiler_host.js +3 -0
- package/src/transformers/compiler_host.js.map +1 -1
- package/src/transformers/lower_expressions.js +3 -2
- package/src/transformers/lower_expressions.js.map +1 -1
- package/src/version.js +1 -1
- package/src/version.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/compiler-cli",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.3",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"typescript": ">=2.4.2 <2.7",
|
|
19
|
-
"@angular/compiler": "5.2.
|
|
19
|
+
"@angular/compiler": "5.2.3"
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
@@ -249,7 +249,7 @@ var MetadataCollector = /** @class */ (function () {
|
|
|
249
249
|
return identifier && (exportMap.get(identifier.text) || identifier.text);
|
|
250
250
|
};
|
|
251
251
|
var exportedName = function (node) { return exportedIdentifierName(node.name); };
|
|
252
|
-
//
|
|
252
|
+
// Pre-declare classes and functions
|
|
253
253
|
ts.forEachChild(sourceFile, function (node) {
|
|
254
254
|
switch (node.kind) {
|
|
255
255
|
case ts.SyntaxKind.ClassDeclaration:
|
|
@@ -410,7 +410,7 @@ var MetadataCollector = /** @class */ (function () {
|
|
|
410
410
|
}
|
|
411
411
|
else {
|
|
412
412
|
nextDefaultValue =
|
|
413
|
-
recordEntry(errorSym('
|
|
413
|
+
recordEntry(errorSym('Unsupported enum member name', member.name), node);
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
if (writtenMembers) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/metadata/collector.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;AAEH,+BAAiC;AAEjC,yCAAmE;AACnE,mCAAu1B;AACv1B,qCAAkC;AAElC,IAAM,QAAQ,GAAG,UAAC,IAAa,IAAK,OAAA,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAA3D,CAA2D,CAAC;AA4BhG;;GAEG;AACH;IACE,2BAAoB,OAA8B;QAA9B,wBAAA,EAAA,YAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;IAAG,CAAC;IAEtD;;;OAGG;IACI,uCAAW,GAAlB,UACI,UAAyB,EAAE,MAAuB,EAClD,oBAA6E;QAFjF,iBAwfC;QAvf8B,uBAAA,EAAA,cAAuB;QAGpD,IAAM,MAAM,GAAG,IAAI,iBAAO,CAAC,UAAU,CAAC,CAAC;QACvC,IAAM,OAAO,GACT,IAAI,GAAG,EAA2E,CAAC;QACvF,IAAM,mBAAmB,GAAG,oBAAoB,IAAI,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;YACnF,UAAC,KAAoB,EAAE,IAAa;gBAChC,OAAA,KAAI,CAAC,OAAO,CAAC,oBAAsB,CAAC,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;YAA5E,CAA4E,CAAC,CAAC;YAClF,oBAAoB,CAAC;QACzB,IAAM,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,cACvC,IAAI,CAAC,OAAO,IAAE,oBAAoB,EAAE,mBA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C5D,CAAC;YACD,KAAK,CAAC;QACR,KAAK,6BAA6B;YAChC,IAAI,MAAM,GACN,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAqB,KAAK,CAAC,OAAO,CAAC,IAAI,SAAM,CAAC,CAAC,CAAC,GAAG,CAAC;YAC9F,MAAM,CAAC,MAAM;gBACT,qHAAqH,CAAC;QAC5H,KAAK,6BAA6B;YAChC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACxC,MAAM,CAAC,iDAA+C,KAAK,CAAC,OAAO,CAAC,IAAI,qCAAkC,CAAC;YAC7G,CAAC;IACL,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;AACvB,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport * as ts from 'typescript';\n\nimport {Evaluator, errorSymbol, recordMapEntry} from './evaluator';\nimport {ClassMetadata, ConstructorMetadata, FunctionMetadata, InterfaceMetadata, METADATA_VERSION, MemberMetadata, MetadataEntry, MetadataError, MetadataMap, MetadataSymbolicBinaryExpression, MetadataSymbolicCallExpression, MetadataSymbolicExpression, MetadataSymbolicIfExpression, MetadataSymbolicIndexExpression, MetadataSymbolicPrefixExpression, MetadataSymbolicReferenceExpression, MetadataSymbolicSelectExpression, MetadataSymbolicSpreadExpression, MetadataValue, MethodMetadata, ModuleExportMetadata, ModuleMetadata, isClassMetadata, isConstructorMetadata, isFunctionMetadata, isMetadataError, isMetadataGlobalReferenceExpression, isMetadataImportDefaultReference, isMetadataImportedSymbolReferenceExpression, isMetadataSymbolicExpression, isMetadataSymbolicReferenceExpression, isMetadataSymbolicSelectExpression, isMethodMetadata} from './schema';\nimport {Symbols} from './symbols';\n\nconst isStatic = (node: ts.Node) => ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Static;\n\n/**\n * A set of collector options to use when collecting metadata.\n */\nexport interface CollectorOptions {\n /**\n * Version of the metadata to collect.\n */\n version?: number;\n\n /**\n * Collect a hidden field \"$quoted$\" in objects literals that record when the key was quoted in\n * the source.\n */\n quotedNames?: boolean;\n\n /**\n * Do not simplify invalid expressions.\n */\n verboseInvalidExpression?: boolean;\n\n /**\n * An expression substitution callback.\n */\n substituteExpression?: (value: MetadataValue, node: ts.Node) => MetadataValue;\n}\n\n/**\n * Collect decorator metadata from a TypeScript module.\n */\nexport class MetadataCollector {\n constructor(private options: CollectorOptions = {}) {}\n\n /**\n * Returns a JSON.stringify friendly form describing the decorators of the exported classes from\n * the source file that is expected to correspond to a module.\n */\n public getMetadata(\n sourceFile: ts.SourceFile, strict: boolean = false,\n substituteExpression?: (value: MetadataValue, node: ts.Node) => MetadataValue): ModuleMetadata\n |undefined {\n const locals = new Symbols(sourceFile);\n const nodeMap =\n new Map<MetadataValue|ClassMetadata|InterfaceMetadata|FunctionMetadata, ts.Node>();\n const composedSubstituter = substituteExpression && this.options.substituteExpression ?\n (value: MetadataValue, node: ts.Node) =>\n this.options.substituteExpression !(substituteExpression(value, node), node) :\n substituteExpression;\n const evaluatorOptions = substituteExpression ?\n {...this.options, substituteExpression: composedSubstituter} :\n this.options;\n let metadata: {[name: string]: MetadataValue | ClassMetadata | FunctionMetadata}|undefined;\n const evaluator = new Evaluator(locals, nodeMap, evaluatorOptions, (name, value) => {\n if (!metadata) metadata = {};\n metadata[name] = value;\n });\n let exports: ModuleExportMetadata[]|undefined = undefined;\n\n function objFromDecorator(decoratorNode: ts.Decorator): MetadataSymbolicExpression {\n return <MetadataSymbolicExpression>evaluator.evaluateNode(decoratorNode.expression);\n }\n\n function recordEntry<T extends MetadataEntry>(entry: T, node: ts.Node): T {\n return recordMapEntry(entry, node, nodeMap, sourceFile);\n }\n\n function errorSym(\n message: string, node?: ts.Node, context?: {[name: string]: string}): MetadataError {\n return errorSymbol(message, node, context, sourceFile);\n }\n\n function maybeGetSimpleFunction(\n functionDeclaration: ts.FunctionDeclaration |\n ts.MethodDeclaration): {func: FunctionMetadata, name: string}|undefined {\n if (functionDeclaration.name && functionDeclaration.name.kind == ts.SyntaxKind.Identifier) {\n const nameNode = <ts.Identifier>functionDeclaration.name;\n const functionName = nameNode.text;\n const functionBody = functionDeclaration.body;\n if (functionBody && functionBody.statements.length == 1) {\n const statement = functionBody.statements[0];\n if (statement.kind === ts.SyntaxKind.ReturnStatement) {\n const returnStatement = <ts.ReturnStatement>statement;\n if (returnStatement.expression) {\n const func: FunctionMetadata = {\n __symbolic: 'function',\n parameters: namesOf(functionDeclaration.parameters),\n value: evaluator.evaluateNode(returnStatement.expression)\n };\n if (functionDeclaration.parameters.some(p => p.initializer != null)) {\n func.defaults = functionDeclaration.parameters.map(\n p => p.initializer && evaluator.evaluateNode(p.initializer));\n }\n return recordEntry({func, name: functionName}, functionDeclaration);\n }\n }\n }\n }\n }\n\n function classMetadataOf(classDeclaration: ts.ClassDeclaration): ClassMetadata {\n const result: ClassMetadata = {__symbolic: 'class'};\n\n function getDecorators(decorators: ReadonlyArray<ts.Decorator>| undefined):\n MetadataSymbolicExpression[]|undefined {\n if (decorators && decorators.length)\n return decorators.map(decorator => objFromDecorator(decorator));\n return undefined;\n }\n\n function referenceFrom(node: ts.Node): MetadataSymbolicReferenceExpression|MetadataError|\n MetadataSymbolicSelectExpression {\n const result = evaluator.evaluateNode(node);\n if (isMetadataError(result) || isMetadataSymbolicReferenceExpression(result) ||\n isMetadataSymbolicSelectExpression(result)) {\n return result;\n } else {\n return errorSym('Symbol reference expected', node);\n }\n }\n\n // Add class parents\n if (classDeclaration.heritageClauses) {\n classDeclaration.heritageClauses.forEach((hc) => {\n if (hc.token === ts.SyntaxKind.ExtendsKeyword && hc.types) {\n hc.types.forEach(type => result.extends = referenceFrom(type.expression));\n }\n });\n }\n\n // Add arity if the type is generic\n const typeParameters = classDeclaration.typeParameters;\n if (typeParameters && typeParameters.length) {\n result.arity = typeParameters.length;\n }\n\n // Add class decorators\n if (classDeclaration.decorators) {\n result.decorators = getDecorators(classDeclaration.decorators);\n }\n\n // member decorators\n let members: MetadataMap|null = null;\n function recordMember(name: string, metadata: MemberMetadata) {\n if (!members) members = {};\n const data = members.hasOwnProperty(name) ? members[name] : [];\n data.push(metadata);\n members[name] = data;\n }\n\n // static member\n let statics: {[name: string]: MetadataValue | FunctionMetadata}|null = null;\n function recordStaticMember(name: string, value: MetadataValue | FunctionMetadata) {\n if (!statics) statics = {};\n statics[name] = value;\n }\n\n for (const member of classDeclaration.members) {\n let isConstructor = false;\n switch (member.kind) {\n case ts.SyntaxKind.Constructor:\n case ts.SyntaxKind.MethodDeclaration:\n isConstructor = member.kind === ts.SyntaxKind.Constructor;\n const method = <ts.MethodDeclaration|ts.ConstructorDeclaration>member;\n if (isStatic(method)) {\n const maybeFunc = maybeGetSimpleFunction(<ts.MethodDeclaration>method);\n if (maybeFunc) {\n recordStaticMember(maybeFunc.name, maybeFunc.func);\n }\n continue;\n }\n const methodDecorators = getDecorators(method.decorators);\n const parameters = method.parameters;\n const parameterDecoratorData:\n ((MetadataSymbolicExpression | MetadataError)[] | undefined)[] = [];\n const parametersData:\n (MetadataSymbolicReferenceExpression | MetadataError |\n MetadataSymbolicSelectExpression | null)[] = [];\n let hasDecoratorData: boolean = false;\n let hasParameterData: boolean = false;\n for (const parameter of parameters) {\n const parameterData = getDecorators(parameter.decorators);\n parameterDecoratorData.push(parameterData);\n hasDecoratorData = hasDecoratorData || !!parameterData;\n if (isConstructor) {\n if (parameter.type) {\n parametersData.push(referenceFrom(parameter.type));\n } else {\n parametersData.push(null);\n }\n hasParameterData = true;\n }\n }\n const data: MethodMetadata = {__symbolic: isConstructor ? 'constructor' : 'method'};\n const name = isConstructor ? '__ctor__' : evaluator.nameOf(member.name);\n if (methodDecorators) {\n data.decorators = methodDecorators;\n }\n if (hasDecoratorData) {\n data.parameterDecorators = parameterDecoratorData;\n }\n if (hasParameterData) {\n (<ConstructorMetadata>data).parameters = parametersData;\n }\n if (!isMetadataError(name)) {\n recordMember(name, data);\n }\n break;\n case ts.SyntaxKind.PropertyDeclaration:\n case ts.SyntaxKind.GetAccessor:\n case ts.SyntaxKind.SetAccessor:\n const property = <ts.PropertyDeclaration>member;\n if (isStatic(property)) {\n const name = evaluator.nameOf(property.name);\n if (!isMetadataError(name)) {\n if (property.initializer) {\n const value = evaluator.evaluateNode(property.initializer);\n recordStaticMember(name, value);\n } else {\n recordStaticMember(name, errorSym('Variable not initialized', property.name));\n }\n }\n }\n const propertyDecorators = getDecorators(property.decorators);\n if (propertyDecorators) {\n const name = evaluator.nameOf(property.name);\n if (!isMetadataError(name)) {\n recordMember(name, {__symbolic: 'property', decorators: propertyDecorators});\n }\n }\n break;\n }\n }\n if (members) {\n result.members = members;\n }\n if (statics) {\n result.statics = statics;\n }\n\n return recordEntry(result, classDeclaration);\n }\n\n // Collect all exported symbols from an exports clause.\n const exportMap = new Map<string, string>();\n ts.forEachChild(sourceFile, node => {\n switch (node.kind) {\n case ts.SyntaxKind.ExportDeclaration:\n const exportDeclaration = <ts.ExportDeclaration>node;\n const {moduleSpecifier, exportClause} = exportDeclaration;\n\n if (!moduleSpecifier) {\n // If there is a module specifier there is also an exportClause\n exportClause !.elements.forEach(spec => {\n const exportedAs = spec.name.text;\n const name = (spec.propertyName || spec.name).text;\n exportMap.set(name, exportedAs);\n });\n }\n }\n });\n\n const isExport = (node: ts.Node) =>\n sourceFile.isDeclarationFile || ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export;\n const isExportedIdentifier = (identifier?: ts.Identifier) =>\n identifier && exportMap.has(identifier.text);\n const isExported =\n (node: ts.FunctionDeclaration | ts.ClassDeclaration | ts.TypeAliasDeclaration |\n ts.InterfaceDeclaration | ts.EnumDeclaration) =>\n isExport(node) || isExportedIdentifier(node.name);\n const exportedIdentifierName = (identifier?: ts.Identifier) =>\n identifier && (exportMap.get(identifier.text) || identifier.text);\n const exportedName =\n (node: ts.FunctionDeclaration | ts.ClassDeclaration | ts.InterfaceDeclaration |\n ts.TypeAliasDeclaration | ts.EnumDeclaration) => exportedIdentifierName(node.name);\n\n\n // Predeclare classes and functions\n ts.forEachChild(sourceFile, node => {\n switch (node.kind) {\n case ts.SyntaxKind.ClassDeclaration:\n const classDeclaration = <ts.ClassDeclaration>node;\n if (classDeclaration.name) {\n const className = classDeclaration.name.text;\n if (isExported(classDeclaration)) {\n locals.define(\n className, {__symbolic: 'reference', name: exportedName(classDeclaration)});\n } else {\n locals.define(\n className, errorSym('Reference to non-exported class', node, {className}));\n }\n }\n break;\n\n case ts.SyntaxKind.InterfaceDeclaration:\n const interfaceDeclaration = <ts.InterfaceDeclaration>node;\n if (interfaceDeclaration.name) {\n const interfaceName = interfaceDeclaration.name.text;\n // All references to interfaces should be converted to references to `any`.\n locals.define(interfaceName, {__symbolic: 'reference', name: 'any'});\n }\n break;\n\n case ts.SyntaxKind.FunctionDeclaration:\n const functionDeclaration = <ts.FunctionDeclaration>node;\n if (!isExported(functionDeclaration)) {\n // Report references to this function as an error.\n const nameNode = functionDeclaration.name;\n if (nameNode && nameNode.text) {\n locals.define(\n nameNode.text,\n errorSym(\n 'Reference to a non-exported function', nameNode, {name: nameNode.text}));\n }\n }\n break;\n }\n });\n\n ts.forEachChild(sourceFile, node => {\n switch (node.kind) {\n case ts.SyntaxKind.ExportDeclaration:\n // Record export declarations\n const exportDeclaration = <ts.ExportDeclaration>node;\n const {moduleSpecifier, exportClause} = exportDeclaration;\n\n if (!moduleSpecifier) {\n // no module specifier -> export {propName as name};\n if (exportClause) {\n exportClause.elements.forEach(spec => {\n const name = spec.name.text;\n // If the symbol was not already exported, export a reference since it is a\n // reference to an import\n if (!metadata || !metadata[name]) {\n const propNode = spec.propertyName || spec.name;\n const value: MetadataValue = evaluator.evaluateNode(propNode);\n if (!metadata) metadata = {};\n metadata[name] = recordEntry(value, node);\n }\n });\n }\n }\n\n if (moduleSpecifier && moduleSpecifier.kind == ts.SyntaxKind.StringLiteral) {\n // Ignore exports that don't have string literals as exports.\n // This is allowed by the syntax but will be flagged as an error by the type checker.\n const from = (<ts.StringLiteral>moduleSpecifier).text;\n const moduleExport: ModuleExportMetadata = {from};\n if (exportClause) {\n moduleExport.export = exportClause.elements.map(\n spec => spec.propertyName ? {name: spec.propertyName.text, as: spec.name.text} :\n spec.name.text);\n }\n if (!exports) exports = [];\n exports.push(moduleExport);\n }\n break;\n case ts.SyntaxKind.ClassDeclaration:\n const classDeclaration = <ts.ClassDeclaration>node;\n if (classDeclaration.name) {\n if (isExported(classDeclaration)) {\n const name = exportedName(classDeclaration);\n if (name) {\n if (!metadata) metadata = {};\n metadata[name] = classMetadataOf(classDeclaration);\n }\n }\n }\n // Otherwise don't record metadata for the class.\n break;\n\n case ts.SyntaxKind.TypeAliasDeclaration:\n const typeDeclaration = <ts.TypeAliasDeclaration>node;\n if (typeDeclaration.name && isExported(typeDeclaration)) {\n const name = exportedName(typeDeclaration);\n if (name) {\n if (!metadata) metadata = {};\n metadata[name] = {__symbolic: 'interface'};\n }\n }\n break;\n\n case ts.SyntaxKind.InterfaceDeclaration:\n const interfaceDeclaration = <ts.InterfaceDeclaration>node;\n if (interfaceDeclaration.name && isExported(interfaceDeclaration)) {\n const name = exportedName(interfaceDeclaration);\n if (name) {\n if (!metadata) metadata = {};\n metadata[name] = {__symbolic: 'interface'};\n }\n }\n break;\n\n case ts.SyntaxKind.FunctionDeclaration:\n // Record functions that return a single value. Record the parameter\n // names substitution will be performed by the StaticReflector.\n const functionDeclaration = <ts.FunctionDeclaration>node;\n if (isExported(functionDeclaration) && functionDeclaration.name) {\n const name = exportedName(functionDeclaration);\n const maybeFunc = maybeGetSimpleFunction(functionDeclaration);\n if (name) {\n if (!metadata) metadata = {};\n metadata[name] =\n maybeFunc ? recordEntry(maybeFunc.func, node) : {__symbolic: 'function'};\n }\n }\n break;\n\n case ts.SyntaxKind.EnumDeclaration:\n const enumDeclaration = <ts.EnumDeclaration>node;\n if (isExported(enumDeclaration)) {\n const enumValueHolder: {[name: string]: MetadataValue} = {};\n const enumName = exportedName(enumDeclaration);\n let nextDefaultValue: MetadataValue = 0;\n let writtenMembers = 0;\n for (const member of enumDeclaration.members) {\n let enumValue: MetadataValue;\n if (!member.initializer) {\n enumValue = nextDefaultValue;\n } else {\n enumValue = evaluator.evaluateNode(member.initializer);\n }\n let name: string|undefined = undefined;\n if (member.name.kind == ts.SyntaxKind.Identifier) {\n const identifier = <ts.Identifier>member.name;\n name = identifier.text;\n enumValueHolder[name] = enumValue;\n writtenMembers++;\n }\n if (typeof enumValue === 'number') {\n nextDefaultValue = enumValue + 1;\n } else if (name) {\n nextDefaultValue = {\n __symbolic: 'binary',\n operator: '+',\n left: {\n __symbolic: 'select',\n expression: recordEntry({__symbolic: 'reference', name: enumName}, node), name\n }\n };\n } else {\n nextDefaultValue =\n recordEntry(errorSym('Unsuppported enum member name', member.name), node);\n }\n }\n if (writtenMembers) {\n if (enumName) {\n if (!metadata) metadata = {};\n metadata[enumName] = recordEntry(enumValueHolder, node);\n }\n }\n }\n break;\n\n case ts.SyntaxKind.VariableStatement:\n const variableStatement = <ts.VariableStatement>node;\n for (const variableDeclaration of variableStatement.declarationList.declarations) {\n if (variableDeclaration.name.kind == ts.SyntaxKind.Identifier) {\n const nameNode = <ts.Identifier>variableDeclaration.name;\n let varValue: MetadataValue;\n if (variableDeclaration.initializer) {\n varValue = evaluator.evaluateNode(variableDeclaration.initializer);\n } else {\n varValue = recordEntry(errorSym('Variable not initialized', nameNode), nameNode);\n }\n let exported = false;\n if (isExport(variableStatement) || isExport(variableDeclaration) ||\n isExportedIdentifier(nameNode)) {\n const name = exportedIdentifierName(nameNode);\n if (name) {\n if (!metadata) metadata = {};\n metadata[name] = recordEntry(varValue, node);\n }\n exported = true;\n }\n if (typeof varValue == 'string' || typeof varValue == 'number' ||\n typeof varValue == 'boolean') {\n locals.define(nameNode.text, varValue);\n if (exported) {\n locals.defineReference(\n nameNode.text, {__symbolic: 'reference', name: nameNode.text});\n }\n } else if (!exported) {\n if (varValue && !isMetadataError(varValue)) {\n locals.define(nameNode.text, recordEntry(varValue, node));\n } else {\n locals.define(\n nameNode.text,\n recordEntry(\n errorSym('Reference to a local symbol', nameNode, {name: nameNode.text}),\n node));\n }\n }\n } else {\n // Destructuring (or binding) declarations are not supported,\n // var {<identifier>[, <identifier>]+} = <expression>;\n // or\n // var [<identifier>[, <identifier}+] = <expression>;\n // are not supported.\n const report: (nameNode: ts.Node) => void = (nameNode: ts.Node) => {\n switch (nameNode.kind) {\n case ts.SyntaxKind.Identifier:\n const name = <ts.Identifier>nameNode;\n const varValue = errorSym('Destructuring not supported', name);\n locals.define(name.text, varValue);\n if (isExport(node)) {\n if (!metadata) metadata = {};\n metadata[name.text] = varValue;\n }\n break;\n case ts.SyntaxKind.BindingElement:\n const bindingElement = <ts.BindingElement>nameNode;\n report(bindingElement.name);\n break;\n case ts.SyntaxKind.ObjectBindingPattern:\n case ts.SyntaxKind.ArrayBindingPattern:\n const bindings = <ts.BindingPattern>nameNode;\n (bindings as any).elements.forEach(report);\n break;\n }\n };\n report(variableDeclaration.name);\n }\n }\n break;\n }\n });\n\n if (metadata || exports) {\n if (!metadata)\n metadata = {};\n else if (strict) {\n validateMetadata(sourceFile, nodeMap, metadata);\n }\n const result: ModuleMetadata = {\n __symbolic: 'module',\n version: this.options.version || METADATA_VERSION, metadata\n };\n if (sourceFile.moduleName) result.importAs = sourceFile.moduleName;\n if (exports) result.exports = exports;\n return result;\n }\n }\n}\n\n// This will throw if the metadata entry given contains an error node.\nfunction validateMetadata(\n sourceFile: ts.SourceFile, nodeMap: Map<MetadataEntry, ts.Node>,\n metadata: {[name: string]: MetadataEntry}) {\n let locals: Set<string> = new Set(['Array', 'Object', 'Set', 'Map', 'string', 'number', 'any']);\n\n function validateExpression(\n expression: MetadataValue | MetadataSymbolicExpression | MetadataError) {\n if (!expression) {\n return;\n } else if (Array.isArray(expression)) {\n expression.forEach(validateExpression);\n } else if (typeof expression === 'object' && !expression.hasOwnProperty('__symbolic')) {\n Object.getOwnPropertyNames(expression).forEach(v => validateExpression((<any>expression)[v]));\n } else if (isMetadataError(expression)) {\n reportError(expression);\n } else if (isMetadataGlobalReferenceExpression(expression)) {\n if (!locals.has(expression.name)) {\n const reference = <MetadataValue>metadata[expression.name];\n if (reference) {\n validateExpression(reference);\n }\n }\n } else if (isFunctionMetadata(expression)) {\n validateFunction(<any>expression);\n } else if (isMetadataSymbolicExpression(expression)) {\n switch (expression.__symbolic) {\n case 'binary':\n const binaryExpression = <MetadataSymbolicBinaryExpression>expression;\n validateExpression(binaryExpression.left);\n validateExpression(binaryExpression.right);\n break;\n case 'call':\n case 'new':\n const callExpression = <MetadataSymbolicCallExpression>expression;\n validateExpression(callExpression.expression);\n if (callExpression.arguments) callExpression.arguments.forEach(validateExpression);\n break;\n case 'index':\n const indexExpression = <MetadataSymbolicIndexExpression>expression;\n validateExpression(indexExpression.expression);\n validateExpression(indexExpression.index);\n break;\n case 'pre':\n const prefixExpression = <MetadataSymbolicPrefixExpression>expression;\n validateExpression(prefixExpression.operand);\n break;\n case 'select':\n const selectExpression = <MetadataSymbolicSelectExpression>expression;\n validateExpression(selectExpression.expression);\n break;\n case 'spread':\n const spreadExpression = <MetadataSymbolicSpreadExpression>expression;\n validateExpression(spreadExpression.expression);\n break;\n case 'if':\n const ifExpression = <MetadataSymbolicIfExpression>expression;\n validateExpression(ifExpression.condition);\n validateExpression(ifExpression.elseExpression);\n validateExpression(ifExpression.thenExpression);\n break;\n }\n }\n }\n\n function validateMember(classData: ClassMetadata, member: MemberMetadata) {\n if (member.decorators) {\n member.decorators.forEach(validateExpression);\n }\n if (isMethodMetadata(member) && member.parameterDecorators) {\n member.parameterDecorators.forEach(validateExpression);\n }\n // Only validate parameters of classes for which we know that are used with our DI\n if (classData.decorators && isConstructorMetadata(member) && member.parameters) {\n member.parameters.forEach(validateExpression);\n }\n }\n\n function validateClass(classData: ClassMetadata) {\n if (classData.decorators) {\n classData.decorators.forEach(validateExpression);\n }\n if (classData.members) {\n Object.getOwnPropertyNames(classData.members)\n .forEach(name => classData.members ![name].forEach((m) => validateMember(classData, m)));\n }\n if (classData.statics) {\n Object.getOwnPropertyNames(classData.statics).forEach(name => {\n const staticMember = classData.statics ![name];\n if (isFunctionMetadata(staticMember)) {\n validateExpression(staticMember.value);\n } else {\n validateExpression(staticMember);\n }\n });\n }\n }\n\n function validateFunction(functionDeclaration: FunctionMetadata) {\n if (functionDeclaration.value) {\n const oldLocals = locals;\n if (functionDeclaration.parameters) {\n locals = new Set(oldLocals.values());\n if (functionDeclaration.parameters)\n functionDeclaration.parameters.forEach(n => locals.add(n));\n }\n validateExpression(functionDeclaration.value);\n locals = oldLocals;\n }\n }\n\n function shouldReportNode(node: ts.Node | undefined) {\n if (node) {\n const nodeStart = node.getStart();\n return !(\n node.pos != nodeStart &&\n sourceFile.text.substring(node.pos, nodeStart).indexOf('@dynamic') >= 0);\n }\n return true;\n }\n\n function reportError(error: MetadataError) {\n const node = nodeMap.get(error);\n if (shouldReportNode(node)) {\n const lineInfo = error.line != undefined ?\n error.character != undefined ? `:${error.line + 1}:${error.character + 1}` :\n `:${error.line + 1}` :\n '';\n throw new Error(\n `${sourceFile.fileName}${lineInfo}: Metadata collected contains an error that will be reported at runtime: ${expandedMessage(error)}.\\n ${JSON.stringify(error)}`);\n }\n }\n\n Object.getOwnPropertyNames(metadata).forEach(name => {\n const entry = metadata[name];\n try {\n if (isClassMetadata(entry)) {\n validateClass(entry);\n }\n } catch (e) {\n const node = nodeMap.get(entry);\n if (shouldReportNode(node)) {\n if (node) {\n const {line, character} = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n throw new Error(\n `${sourceFile.fileName}:${line + 1}:${character + 1}: Error encountered in metadata generated for exported symbol '${name}': \\n ${e.message}`);\n }\n throw new Error(\n `Error encountered in metadata generated for exported symbol ${name}: \\n ${e.message}`);\n }\n }\n });\n}\n\n// Collect parameter names from a function.\nfunction namesOf(parameters: ts.NodeArray<ts.ParameterDeclaration>): string[] {\n const result: string[] = [];\n\n function addNamesOf(name: ts.Identifier | ts.BindingPattern) {\n if (name.kind == ts.SyntaxKind.Identifier) {\n const identifier = <ts.Identifier>name;\n result.push(identifier.text);\n } else {\n const bindingPattern = <ts.BindingPattern>name;\n for (const element of bindingPattern.elements) {\n const name = (element as any).name;\n if (name) {\n addNamesOf(name);\n }\n }\n }\n }\n\n for (const parameter of parameters) {\n addNamesOf(parameter.name);\n }\n\n return result;\n}\n\nfunction expandedMessage(error: any): string {\n switch (error.message) {\n case 'Reference to non-exported class':\n if (error.context && error.context.className) {\n return `Reference to a non-exported class ${error.context.className}. Consider exporting the class`;\n }\n break;\n case 'Variable not initialized':\n return 'Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler';\n case 'Destructuring not supported':\n return 'Referencing an exported destructured variable or constant is not supported by the template compiler. Consider simplifying this to avoid destructuring';\n case 'Could not resolve type':\n if (error.context && error.context.typeName) {\n return `Could not resolve type ${error.context.typeName}`;\n }\n break;\n case 'Function call not supported':\n let prefix =\n error.context && error.context.name ? `Calling function '${error.context.name}', f` : 'F';\n return prefix +\n 'unction calls are not supported. Consider replacing the function or lambda with a reference to an exported function';\n case 'Reference to a local symbol':\n if (error.context && error.context.name) {\n return `Reference to a local (non-exported) symbol '${error.context.name}'. Consider exporting the symbol`;\n }\n }\n return error.message;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/metadata/collector.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;AAEH,+BAAiC;AAEjC,yCAAmE;AACnE,mCAAu1B;AACv1B,qCAAkC;AAElC,IAAM,QAAQ,GAAG,UAAC,IAAa,IAAK,OAAA,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAA3D,CAA2D,CAAC;AA4BhG;;G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cesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport * as ts from 'typescript';\n\nimport {Evaluator, errorSymbol, recordMapEntry} from './evaluator';\nimport {ClassMetadata, ConstructorMetadata, FunctionMetadata, InterfaceMetadata, METADATA_VERSION, MemberMetadata, MetadataEntry, MetadataError, MetadataMap, MetadataSymbolicBinaryExpression, MetadataSymbolicCallExpression, MetadataSymbolicExpression, MetadataSymbolicIfExpression, MetadataSymbolicIndexExpression, MetadataSymbolicPrefixExpression, MetadataSymbolicReferenceExpression, MetadataSymbolicSelectExpression, MetadataSymbolicSpreadExpression, MetadataValue, MethodMetadata, ModuleExportMetadata, ModuleMetadata, isClassMetadata, isConstructorMetadata, isFunctionMetadata, isMetadataError, isMetadataGlobalReferenceExpression, isMetadataImportDefaultReference, isMetadataImportedSymbolReferenceExpression, isMetadataSymbolicExpression, isMetadataSymbolicReferenceExpression, isMetadataSymbolicSelectExpression, isMethodMetadata} from './schema';\nimport {Symbols} from './symbols';\n\nconst isStatic = (node: ts.Node) => ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Static;\n\n/**\n * A set of collector options to use when collecting metadata.\n */\nexport interface CollectorOptions {\n /**\n * Version of the metadata to collect.\n */\n version?: number;\n\n /**\n * Collect a hidden field \"$quoted$\" in objects literals that record when the key was quoted in\n * the source.\n */\n quotedNames?: boolean;\n\n /**\n * Do not simplify invalid expressions.\n */\n verboseInvalidExpression?: boolean;\n\n /**\n * An expression substitution callback.\n */\n substituteExpression?: (value: MetadataValue, node: ts.Node) => MetadataValue;\n}\n\n/**\n * Collect decorator metadata from a TypeScript module.\n */\nexport class MetadataCollector {\n constructor(private options: CollectorOptions = {}) {}\n\n /**\n * Returns a JSON.stringify friendly form describing the decorators of the exported classes from\n * the source file that is expected to correspond to a module.\n */\n public getMetadata(\n sourceFile: ts.SourceFile, strict: boolean = false,\n substituteExpression?: (value: MetadataValue, node: ts.Node) => MetadataValue): ModuleMetadata\n |undefined {\n const locals = new Symbols(sourceFile);\n const nodeMap =\n new Map<MetadataValue|ClassMetadata|InterfaceMetadata|FunctionMetadata, ts.Node>();\n const composedSubstituter = substituteExpression && this.options.substituteExpression ?\n (value: MetadataValue, node: ts.Node) =>\n this.options.substituteExpression !(substituteExpression(value, node), node) :\n substituteExpression;\n const evaluatorOptions = substituteExpression ?\n {...this.options, substituteExpression: composedSubstituter} :\n this.options;\n let metadata: {[name: string]: MetadataValue | ClassMetadata | FunctionMetadata}|undefined;\n const evaluator = new Evaluator(locals, nodeMap, evaluatorOptions, (name, value) => {\n if (!metadata) metadata = {};\n metadata[name] = value;\n });\n let exports: ModuleExportMetadata[]|undefined = undefined;\n\n function objFromDecorator(decoratorNode: ts.Decorator): MetadataSymbolicExpression {\n return <MetadataSymbolicExpression>evaluator.evaluateNode(decoratorNode.expression);\n }\n\n function recordEntry<T extends MetadataEntry>(entry: T, node: ts.Node): T {\n return recordMapEntry(entry, node, nodeMap, sourceFile);\n }\n\n function errorSym(\n message: string, node?: ts.Node, context?: {[name: string]: string}): MetadataError {\n return errorSymbol(message, node, context, sourceFile);\n }\n\n function maybeGetSimpleFunction(\n functionDeclaration: ts.FunctionDeclaration |\n ts.MethodDeclaration): {func: FunctionMetadata, name: string}|undefined {\n if (functionDeclaration.name && functionDeclaration.name.kind == ts.SyntaxKind.Identifier) {\n const nameNode = <ts.Identifier>functionDeclaration.name;\n const functionName = nameNode.text;\n const functionBody = functionDeclaration.body;\n if (functionBody && functionBody.statements.length == 1) {\n const statement = functionBody.statements[0];\n if (statement.kind === ts.SyntaxKind.ReturnStatement) {\n const returnStatement = <ts.ReturnStatement>statement;\n if (returnStatement.expression) {\n const func: FunctionMetadata = {\n __symbolic: 'function',\n parameters: namesOf(functionDeclaration.parameters),\n value: evaluator.evaluateNode(returnStatement.expression)\n };\n if (functionDeclaration.parameters.some(p => p.initializer != null)) {\n func.defaults = functionDeclaration.parameters.map(\n p => p.initializer && evaluator.evaluateNode(p.initializer));\n }\n return recordEntry({func, name: functionName}, functionDeclaration);\n }\n }\n }\n }\n }\n\n function classMetadataOf(classDeclaration: ts.ClassDeclaration): ClassMetadata {\n const result: ClassMetadata = {__symbolic: 'class'};\n\n function getDecorators(decorators: ReadonlyArray<ts.Decorator>| undefined):\n MetadataSymbolicExpression[]|undefined {\n if (decorators && decorators.length)\n return decorators.map(decorator => objFromDecorator(decorator));\n return undefined;\n }\n\n function referenceFrom(node: ts.Node): MetadataSymbolicReferenceExpression|MetadataError|\n MetadataSymbolicSelectExpression {\n const result = evaluator.evaluateNode(node);\n if (isMetadataError(result) || isMetadataSymbolicReferenceExpression(result) ||\n isMetadataSymbolicSelectExpression(result)) {\n return result;\n } else {\n return errorSym('Symbol reference expected', node);\n }\n }\n\n // Add class parents\n if (classDeclaration.heritageClauses) {\n classDeclaration.heritageClauses.forEach((hc) => {\n if (hc.token === ts.SyntaxKind.ExtendsKeyword && hc.types) {\n hc.types.forEach(type => result.extends = referenceFrom(type.expression));\n }\n });\n }\n\n // Add arity if the type is generic\n const typeParameters = classDeclaration.typeParameters;\n if (typeParameters && typeParameters.length) {\n result.arity = typeParameters.length;\n }\n\n // Add class decorators\n if (classDeclaration.decorators) {\n result.decorators = getDecorators(classDeclaration.decorators);\n }\n\n // member decorators\n let members: MetadataMap|null = null;\n function recordMember(name: string, metadata: MemberMetadata) {\n if (!members) members = {};\n const data = members.hasOwnProperty(name) ? members[name] : [];\n data.push(metadata);\n members[name] = data;\n }\n\n // static member\n let statics: {[name: string]: MetadataValue | FunctionMetadata}|null = null;\n function recordStaticMember(name: string, value: MetadataValue | FunctionMetadata) {\n if (!statics) statics = {};\n statics[name] = value;\n }\n\n for (const member of classDeclaration.members) {\n let isConstructor = false;\n switch (member.kind) {\n case ts.SyntaxKind.Constructor:\n case ts.SyntaxKind.MethodDeclaration:\n isConstructor = member.kind === ts.SyntaxKind.Constructor;\n const method = <ts.MethodDeclaration|ts.ConstructorDeclaration>member;\n if (isStatic(method)) {\n const maybeFunc = maybeGetSimpleFunction(<ts.MethodDeclaration>method);\n if (maybeFunc) {\n recordStaticMember(maybeFunc.name, maybeFunc.func);\n }\n continue;\n }\n const methodDecorators = getDecorators(method.decorators);\n const parameters = method.parameters;\n const parameterDecoratorData:\n ((MetadataSymbolicExpression | MetadataError)[] | undefined)[] = [];\n const parametersData:\n (MetadataSymbolicReferenceExpression | MetadataError |\n MetadataSymbolicSelectExpression | null)[] = [];\n let hasDecoratorData: boolean = false;\n let hasParameterData: boolean = false;\n for (const parameter of parameters) {\n const parameterData = getDecorators(parameter.decorators);\n parameterDecoratorData.push(parameterData);\n hasDecoratorData = hasDecoratorData || !!parameterData;\n if (isConstructor) {\n if (parameter.type) {\n parametersData.push(referenceFrom(parameter.type));\n } else {\n parametersData.push(null);\n }\n hasParameterData = true;\n }\n }\n const data: MethodMetadata = {__symbolic: isConstructor ? 'constructor' : 'method'};\n const name = isConstructor ? '__ctor__' : evaluator.nameOf(member.name);\n if (methodDecorators) {\n data.decorators = methodDecorators;\n }\n if (hasDecoratorData) {\n data.parameterDecorators = parameterDecoratorData;\n }\n if (hasParameterData) {\n (<ConstructorMetadata>data).parameters = parametersData;\n }\n if (!isMetadataError(name)) {\n recordMember(name, data);\n }\n break;\n case ts.SyntaxKind.PropertyDeclaration:\n case ts.SyntaxKind.GetAccessor:\n case ts.SyntaxKind.SetAccessor:\n const property = <ts.PropertyDeclaration>member;\n if (isStatic(property)) {\n const name = evaluator.nameOf(property.name);\n if (!isMetadataError(name)) {\n if (property.initializer) {\n const value = evaluator.evaluateNode(property.initializer);\n recordStaticMember(name, value);\n } else {\n recordStaticMember(name, errorSym('Variable not initialized', property.name));\n }\n }\n }\n const propertyDecorators = getDecorators(property.decorators);\n if (propertyDecorators) {\n const name = evaluator.nameOf(property.name);\n if (!isMetadataError(name)) {\n recordMember(name, {__symbolic: 'property', decorators: propertyDecorators});\n }\n }\n break;\n }\n }\n if (members) {\n result.members = members;\n }\n if (statics) {\n result.statics = statics;\n }\n\n return recordEntry(result, classDeclaration);\n }\n\n // Collect all exported symbols from an exports clause.\n const exportMap = new Map<string, string>();\n ts.forEachChild(sourceFile, node => {\n switch (node.kind) {\n case ts.SyntaxKind.ExportDeclaration:\n const exportDeclaration = <ts.ExportDeclaration>node;\n const {moduleSpecifier, exportClause} = exportDeclaration;\n\n if (!moduleSpecifier) {\n // If there is a module specifier there is also an exportClause\n exportClause !.elements.forEach(spec => {\n const exportedAs = spec.name.text;\n const name = (spec.propertyName || spec.name).text;\n exportMap.set(name, exportedAs);\n });\n }\n }\n });\n\n const isExport = (node: ts.Node) =>\n sourceFile.isDeclarationFile || ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export;\n const isExportedIdentifier = (identifier?: ts.Identifier) =>\n identifier && exportMap.has(identifier.text);\n const isExported =\n (node: ts.FunctionDeclaration | ts.ClassDeclaration | ts.TypeAliasDeclaration |\n ts.InterfaceDeclaration | ts.EnumDeclaration) =>\n isExport(node) || isExportedIdentifier(node.name);\n const exportedIdentifierName = (identifier?: ts.Identifier) =>\n identifier && (exportMap.get(identifier.text) || identifier.text);\n const exportedName =\n (node: ts.FunctionDeclaration | ts.ClassDeclaration | ts.InterfaceDeclaration |\n ts.TypeAliasDeclaration | ts.EnumDeclaration) => exportedIdentifierName(node.name);\n\n\n // Pre-declare classes and functions\n ts.forEachChild(sourceFile, node => {\n switch (node.kind) {\n case ts.SyntaxKind.ClassDeclaration:\n const classDeclaration = <ts.ClassDeclaration>node;\n if (classDeclaration.name) {\n const className = classDeclaration.name.text;\n if (isExported(classDeclaration)) {\n locals.define(\n className, {__symbolic: 'reference', name: exportedName(classDeclaration)});\n } else {\n locals.define(\n className, errorSym('Reference to non-exported class', node, {className}));\n }\n }\n break;\n\n case ts.SyntaxKind.InterfaceDeclaration:\n const interfaceDeclaration = <ts.InterfaceDeclaration>node;\n if (interfaceDeclaration.name) {\n const interfaceName = interfaceDeclaration.name.text;\n // All references to interfaces should be converted to references to `any`.\n locals.define(interfaceName, {__symbolic: 'reference', name: 'any'});\n }\n break;\n\n case ts.SyntaxKind.FunctionDeclaration:\n const functionDeclaration = <ts.FunctionDeclaration>node;\n if (!isExported(functionDeclaration)) {\n // Report references to this function as an error.\n const nameNode = functionDeclaration.name;\n if (nameNode && nameNode.text) {\n locals.define(\n nameNode.text,\n errorSym(\n 'Reference to a non-exported function', nameNode, {name: nameNode.text}));\n }\n }\n break;\n }\n });\n\n ts.forEachChild(sourceFile, node => {\n switch (node.kind) {\n case ts.SyntaxKind.ExportDeclaration:\n // Record export declarations\n const exportDeclaration = <ts.ExportDeclaration>node;\n const {moduleSpecifier, exportClause} = exportDeclaration;\n\n if (!moduleSpecifier) {\n // no module specifier -> export {propName as name};\n if (exportClause) {\n exportClause.elements.forEach(spec => {\n const name = spec.name.text;\n // If the symbol was not already exported, export a reference since it is a\n // reference to an import\n if (!metadata || !metadata[name]) {\n const propNode = spec.propertyName || spec.name;\n const value: MetadataValue = evaluator.evaluateNode(propNode);\n if (!metadata) metadata = {};\n metadata[name] = recordEntry(value, node);\n }\n });\n }\n }\n\n if (moduleSpecifier && moduleSpecifier.kind == ts.SyntaxKind.StringLiteral) {\n // Ignore exports that don't have string literals as exports.\n // This is allowed by the syntax but will be flagged as an error by the type checker.\n const from = (<ts.StringLiteral>moduleSpecifier).text;\n const moduleExport: ModuleExportMetadata = {from};\n if (exportClause) {\n moduleExport.export = exportClause.elements.map(\n spec => spec.propertyName ? {name: spec.propertyName.text, as: spec.name.text} :\n spec.name.text);\n }\n if (!exports) exports = [];\n exports.push(moduleExport);\n }\n break;\n case ts.SyntaxKind.ClassDeclaration:\n const classDeclaration = <ts.ClassDeclaration>node;\n if (classDeclaration.name) {\n if (isExported(classDeclaration)) {\n const name = exportedName(classDeclaration);\n if (name) {\n if (!metadata) metadata = {};\n metadata[name] = classMetadataOf(classDeclaration);\n }\n }\n }\n // Otherwise don't record metadata for the class.\n break;\n\n case ts.SyntaxKind.TypeAliasDeclaration:\n const typeDeclaration = <ts.TypeAliasDeclaration>node;\n if (typeDeclaration.name && isExported(typeDeclaration)) {\n const name = exportedName(typeDeclaration);\n if (name) {\n if (!metadata) metadata = {};\n metadata[name] = {__symbolic: 'interface'};\n }\n }\n break;\n\n case ts.SyntaxKind.InterfaceDeclaration:\n const interfaceDeclaration = <ts.InterfaceDeclaration>node;\n if (interfaceDeclaration.name && isExported(interfaceDeclaration)) {\n const name = exportedName(interfaceDeclaration);\n if (name) {\n if (!metadata) metadata = {};\n metadata[name] = {__symbolic: 'interface'};\n }\n }\n break;\n\n case ts.SyntaxKind.FunctionDeclaration:\n // Record functions that return a single value. Record the parameter\n // names substitution will be performed by the StaticReflector.\n const functionDeclaration = <ts.FunctionDeclaration>node;\n if (isExported(functionDeclaration) && functionDeclaration.name) {\n const name = exportedName(functionDeclaration);\n const maybeFunc = maybeGetSimpleFunction(functionDeclaration);\n if (name) {\n if (!metadata) metadata = {};\n metadata[name] =\n maybeFunc ? recordEntry(maybeFunc.func, node) : {__symbolic: 'function'};\n }\n }\n break;\n\n case ts.SyntaxKind.EnumDeclaration:\n const enumDeclaration = <ts.EnumDeclaration>node;\n if (isExported(enumDeclaration)) {\n const enumValueHolder: {[name: string]: MetadataValue} = {};\n const enumName = exportedName(enumDeclaration);\n let nextDefaultValue: MetadataValue = 0;\n let writtenMembers = 0;\n for (const member of enumDeclaration.members) {\n let enumValue: MetadataValue;\n if (!member.initializer) {\n enumValue = nextDefaultValue;\n } else {\n enumValue = evaluator.evaluateNode(member.initializer);\n }\n let name: string|undefined = undefined;\n if (member.name.kind == ts.SyntaxKind.Identifier) {\n const identifier = <ts.Identifier>member.name;\n name = identifier.text;\n enumValueHolder[name] = enumValue;\n writtenMembers++;\n }\n if (typeof enumValue === 'number') {\n nextDefaultValue = enumValue + 1;\n } else if (name) {\n nextDefaultValue = {\n __symbolic: 'binary',\n operator: '+',\n left: {\n __symbolic: 'select',\n expression: recordEntry({__symbolic: 'reference', name: enumName}, node), name\n }\n };\n } else {\n nextDefaultValue =\n recordEntry(errorSym('Unsupported enum member name', member.name), node);\n }\n }\n if (writtenMembers) {\n if (enumName) {\n if (!metadata) metadata = {};\n metadata[enumName] = recordEntry(enumValueHolder, node);\n }\n }\n }\n break;\n\n case ts.SyntaxKind.VariableStatement:\n const variableStatement = <ts.VariableStatement>node;\n for (const variableDeclaration of variableStatement.declarationList.declarations) {\n if (variableDeclaration.name.kind == ts.SyntaxKind.Identifier) {\n const nameNode = <ts.Identifier>variableDeclaration.name;\n let varValue: MetadataValue;\n if (variableDeclaration.initializer) {\n varValue = evaluator.evaluateNode(variableDeclaration.initializer);\n } else {\n varValue = recordEntry(errorSym('Variable not initialized', nameNode), nameNode);\n }\n let exported = false;\n if (isExport(variableStatement) || isExport(variableDeclaration) ||\n isExportedIdentifier(nameNode)) {\n const name = exportedIdentifierName(nameNode);\n if (name) {\n if (!metadata) metadata = {};\n metadata[name] = recordEntry(varValue, node);\n }\n exported = true;\n }\n if (typeof varValue == 'string' || typeof varValue == 'number' ||\n typeof varValue == 'boolean') {\n locals.define(nameNode.text, varValue);\n if (exported) {\n locals.defineReference(\n nameNode.text, {__symbolic: 'reference', name: nameNode.text});\n }\n } else if (!exported) {\n if (varValue && !isMetadataError(varValue)) {\n locals.define(nameNode.text, recordEntry(varValue, node));\n } else {\n locals.define(\n nameNode.text,\n recordEntry(\n errorSym('Reference to a local symbol', nameNode, {name: nameNode.text}),\n node));\n }\n }\n } else {\n // Destructuring (or binding) declarations are not supported,\n // var {<identifier>[, <identifier>]+} = <expression>;\n // or\n // var [<identifier>[, <identifier}+] = <expression>;\n // are not supported.\n const report: (nameNode: ts.Node) => void = (nameNode: ts.Node) => {\n switch (nameNode.kind) {\n case ts.SyntaxKind.Identifier:\n const name = <ts.Identifier>nameNode;\n const varValue = errorSym('Destructuring not supported', name);\n locals.define(name.text, varValue);\n if (isExport(node)) {\n if (!metadata) metadata = {};\n metadata[name.text] = varValue;\n }\n break;\n case ts.SyntaxKind.BindingElement:\n const bindingElement = <ts.BindingElement>nameNode;\n report(bindingElement.name);\n break;\n case ts.SyntaxKind.ObjectBindingPattern:\n case ts.SyntaxKind.ArrayBindingPattern:\n const bindings = <ts.BindingPattern>nameNode;\n (bindings as any).elements.forEach(report);\n break;\n }\n };\n report(variableDeclaration.name);\n }\n }\n break;\n }\n });\n\n if (metadata || exports) {\n if (!metadata)\n metadata = {};\n else if (strict) {\n validateMetadata(sourceFile, nodeMap, metadata);\n }\n const result: ModuleMetadata = {\n __symbolic: 'module',\n version: this.options.version || METADATA_VERSION, metadata\n };\n if (sourceFile.moduleName) result.importAs = sourceFile.moduleName;\n if (exports) result.exports = exports;\n return result;\n }\n }\n}\n\n// This will throw if the metadata entry given contains an error node.\nfunction validateMetadata(\n sourceFile: ts.SourceFile, nodeMap: Map<MetadataEntry, ts.Node>,\n metadata: {[name: string]: MetadataEntry}) {\n let locals: Set<string> = new Set(['Array', 'Object', 'Set', 'Map', 'string', 'number', 'any']);\n\n function validateExpression(\n expression: MetadataValue | MetadataSymbolicExpression | MetadataError) {\n if (!expression) {\n return;\n } else if (Array.isArray(expression)) {\n expression.forEach(validateExpression);\n } else if (typeof expression === 'object' && !expression.hasOwnProperty('__symbolic')) {\n Object.getOwnPropertyNames(expression).forEach(v => validateExpression((<any>expression)[v]));\n } else if (isMetadataError(expression)) {\n reportError(expression);\n } else if (isMetadataGlobalReferenceExpression(expression)) {\n if (!locals.has(expression.name)) {\n const reference = <MetadataValue>metadata[expression.name];\n if (reference) {\n validateExpression(reference);\n }\n }\n } else if (isFunctionMetadata(expression)) {\n validateFunction(<any>expression);\n } else if (isMetadataSymbolicExpression(expression)) {\n switch (expression.__symbolic) {\n case 'binary':\n const binaryExpression = <MetadataSymbolicBinaryExpression>expression;\n validateExpression(binaryExpression.left);\n validateExpression(binaryExpression.right);\n break;\n case 'call':\n case 'new':\n const callExpression = <MetadataSymbolicCallExpression>expression;\n validateExpression(callExpression.expression);\n if (callExpression.arguments) callExpression.arguments.forEach(validateExpression);\n break;\n case 'index':\n const indexExpression = <MetadataSymbolicIndexExpression>expression;\n validateExpression(indexExpression.expression);\n validateExpression(indexExpression.index);\n break;\n case 'pre':\n const prefixExpression = <MetadataSymbolicPrefixExpression>expression;\n validateExpression(prefixExpression.operand);\n break;\n case 'select':\n const selectExpression = <MetadataSymbolicSelectExpression>expression;\n validateExpression(selectExpression.expression);\n break;\n case 'spread':\n const spreadExpression = <MetadataSymbolicSpreadExpression>expression;\n validateExpression(spreadExpression.expression);\n break;\n case 'if':\n const ifExpression = <MetadataSymbolicIfExpression>expression;\n validateExpression(ifExpression.condition);\n validateExpression(ifExpression.elseExpression);\n validateExpression(ifExpression.thenExpression);\n break;\n }\n }\n }\n\n function validateMember(classData: ClassMetadata, member: MemberMetadata) {\n if (member.decorators) {\n member.decorators.forEach(validateExpression);\n }\n if (isMethodMetadata(member) && member.parameterDecorators) {\n member.parameterDecorators.forEach(validateExpression);\n }\n // Only validate parameters of classes for which we know that are used with our DI\n if (classData.decorators && isConstructorMetadata(member) && member.parameters) {\n member.parameters.forEach(validateExpression);\n }\n }\n\n function validateClass(classData: ClassMetadata) {\n if (classData.decorators) {\n classData.decorators.forEach(validateExpression);\n }\n if (classData.members) {\n Object.getOwnPropertyNames(classData.members)\n .forEach(name => classData.members ![name].forEach((m) => validateMember(classData, m)));\n }\n if (classData.statics) {\n Object.getOwnPropertyNames(classData.statics).forEach(name => {\n const staticMember = classData.statics ![name];\n if (isFunctionMetadata(staticMember)) {\n validateExpression(staticMember.value);\n } else {\n validateExpression(staticMember);\n }\n });\n }\n }\n\n function validateFunction(functionDeclaration: FunctionMetadata) {\n if (functionDeclaration.value) {\n const oldLocals = locals;\n if (functionDeclaration.parameters) {\n locals = new Set(oldLocals.values());\n if (functionDeclaration.parameters)\n functionDeclaration.parameters.forEach(n => locals.add(n));\n }\n validateExpression(functionDeclaration.value);\n locals = oldLocals;\n }\n }\n\n function shouldReportNode(node: ts.Node | undefined) {\n if (node) {\n const nodeStart = node.getStart();\n return !(\n node.pos != nodeStart &&\n sourceFile.text.substring(node.pos, nodeStart).indexOf('@dynamic') >= 0);\n }\n return true;\n }\n\n function reportError(error: MetadataError) {\n const node = nodeMap.get(error);\n if (shouldReportNode(node)) {\n const lineInfo = error.line != undefined ?\n error.character != undefined ? `:${error.line + 1}:${error.character + 1}` :\n `:${error.line + 1}` :\n '';\n throw new Error(\n `${sourceFile.fileName}${lineInfo}: Metadata collected contains an error that will be reported at runtime: ${expandedMessage(error)}.\\n ${JSON.stringify(error)}`);\n }\n }\n\n Object.getOwnPropertyNames(metadata).forEach(name => {\n const entry = metadata[name];\n try {\n if (isClassMetadata(entry)) {\n validateClass(entry);\n }\n } catch (e) {\n const node = nodeMap.get(entry);\n if (shouldReportNode(node)) {\n if (node) {\n const {line, character} = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n throw new Error(\n `${sourceFile.fileName}:${line + 1}:${character + 1}: Error encountered in metadata generated for exported symbol '${name}': \\n ${e.message}`);\n }\n throw new Error(\n `Error encountered in metadata generated for exported symbol ${name}: \\n ${e.message}`);\n }\n }\n });\n}\n\n// Collect parameter names from a function.\nfunction namesOf(parameters: ts.NodeArray<ts.ParameterDeclaration>): string[] {\n const result: string[] = [];\n\n function addNamesOf(name: ts.Identifier | ts.BindingPattern) {\n if (name.kind == ts.SyntaxKind.Identifier) {\n const identifier = <ts.Identifier>name;\n result.push(identifier.text);\n } else {\n const bindingPattern = <ts.BindingPattern>name;\n for (const element of bindingPattern.elements) {\n const name = (element as any).name;\n if (name) {\n addNamesOf(name);\n }\n }\n }\n }\n\n for (const parameter of parameters) {\n addNamesOf(parameter.name);\n }\n\n return result;\n}\n\nfunction expandedMessage(error: any): string {\n switch (error.message) {\n case 'Reference to non-exported class':\n if (error.context && error.context.className) {\n return `Reference to a non-exported class ${error.context.className}. Consider exporting the class`;\n }\n break;\n case 'Variable not initialized':\n return 'Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler';\n case 'Destructuring not supported':\n return 'Referencing an exported destructured variable or constant is not supported by the template compiler. Consider simplifying this to avoid destructuring';\n case 'Could not resolve type':\n if (error.context && error.context.typeName) {\n return `Could not resolve type ${error.context.typeName}`;\n }\n break;\n case 'Function call not supported':\n let prefix =\n error.context && error.context.name ? `Calling function '${error.context.name}', f` : 'F';\n return prefix +\n 'unction calls are not supported. Consider replacing the function or lambda with a reference to an exported function';\n case 'Reference to a local symbol':\n if (error.context && error.context.name) {\n return `Reference to a local (non-exported) symbol '${error.context.name}'. Consider exporting the symbol`;\n }\n }\n return error.message;\n}\n"]}
|
|
@@ -330,9 +330,6 @@ var Evaluator = /** @class */ (function () {
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
var args = arrayOrEmpty(callExpression.arguments).map(function (arg) { return _this.evaluateNode(arg); });
|
|
333
|
-
if (!this.options.verboseInvalidExpression && args.some(schema_1.isMetadataError)) {
|
|
334
|
-
return args.find(schema_1.isMetadataError);
|
|
335
|
-
}
|
|
336
333
|
if (this.isFoldable(callExpression)) {
|
|
337
334
|
if (isMethodCallOf(callExpression, 'concat')) {
|
|
338
335
|
var arrayValue = this.evaluateNode(callExpression.expression.expression);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/metadata/evaluator.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;AAEH,+BAAiC;AAGjC,mCAAqd;AAKrd,yDAAyD;AACzD,IAAM,uBAAuB,GACxB,EAAE,CAAC,UAAkB,CAAC,aAAa,IAAK,EAAE,CAAC,UAAkB,CAAC,uBAAuB,CAAC;AAE3F,wBAAwB,cAAiC,EAAE,UAAkB;IAC3E,IAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC;IAC7C,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC,CAAC;QAC/D,IAAM,wBAA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,MAAM,CAAC,EAAC,UAAU,EAAE,OAAO,EAAC,CAAC;QACjC,CAAC;QACD,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,+BAA+B,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAC/E,CAAC;IACH,gBAAC;AAAD,CAAC,AAvjBD,IAujBC;AAvjBY,8BAAS;AAyjBtB,8BAA8B,IAAa;IACzC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC;AACvD,CAAC;AAED,IAAM,KAAK,GAAG,EAAE,CAAC,eAAe,EAAO,CAAC;AAExC,sBAAyC,CAA6B;IACpE,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC;AACpB,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport * as ts from 'typescript';\n\nimport {CollectorOptions} from './collector';\nimport {ClassMetadata, FunctionMetadata, InterfaceMetadata, MetadataEntry, MetadataError, MetadataImportedSymbolReferenceExpression, MetadataSourceLocationInfo, MetadataSymbolicCallExpression, MetadataValue, isMetadataError, isMetadataGlobalReferenceExpression, isMetadataImportDefaultReference, isMetadataImportedSymbolReferenceExpression, isMetadataModuleReferenceExpression, isMetadataSymbolicReferenceExpression, isMetadataSymbolicSpreadExpression} from './schema';\nimport {Symbols} from './symbols';\n\n\n\n// In TypeScript 2.1 the spread element kind was renamed.\nconst spreadElementSyntaxKind: ts.SyntaxKind =\n (ts.SyntaxKind as any).SpreadElement || (ts.SyntaxKind as any).SpreadElementExpression;\n\nfunction isMethodCallOf(callExpression: ts.CallExpression, memberName: string): boolean {\n const expression = callExpression.expression;\n if (expression.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const propertyAccessExpression = <ts.PropertyAccessExpression>expression;\n const name = propertyAccessExpression.name;\n if (name.kind == ts.SyntaxKind.Identifier) {\n return name.text === memberName;\n }\n }\n return false;\n}\n\nfunction isCallOf(callExpression: ts.CallExpression, ident: string): boolean {\n const expression = callExpression.expression;\n if (expression.kind === ts.SyntaxKind.Identifier) {\n const identifier = <ts.Identifier>expression;\n return identifier.text === ident;\n }\n return false;\n}\n\n/* @internal */\nexport function recordMapEntry<T extends MetadataEntry>(\n entry: T, node: ts.Node,\n nodeMap: Map<MetadataValue|ClassMetadata|InterfaceMetadata|FunctionMetadata, ts.Node>,\n sourceFile?: ts.SourceFile) {\n if (!nodeMap.has(entry)) {\n nodeMap.set(entry, node);\n if (node && (isMetadataImportedSymbolReferenceExpression(entry) ||\n isMetadataImportDefaultReference(entry)) &&\n entry.line == null) {\n const info = sourceInfo(node, sourceFile);\n if (info.line != null) entry.line = info.line;\n if (info.character != null) entry.character = info.character;\n }\n }\n return entry;\n}\n\n/**\n * ts.forEachChild stops iterating children when the callback return a truthy value.\n * This method inverts this to implement an `every` style iterator. It will return\n * true if every call to `cb` returns `true`.\n */\nfunction everyNodeChild(node: ts.Node, cb: (node: ts.Node) => boolean) {\n return !ts.forEachChild(node, node => !cb(node));\n}\n\nexport function isPrimitive(value: any): boolean {\n return Object(value) !== value;\n}\n\nfunction isDefined(obj: any): boolean {\n return obj !== undefined;\n}\n\n// import {propertyName as name} from 'place'\n// import {name} from 'place'\nexport interface ImportSpecifierMetadata {\n name: string;\n propertyName?: string;\n}\nexport interface ImportMetadata {\n defaultName?: string; // import d from 'place'\n namespace?: string; // import * as d from 'place'\n namedImports?: ImportSpecifierMetadata[]; // import {a} from 'place'\n from: string; // from 'place'\n}\n\n\nfunction getSourceFileOfNode(node: ts.Node | undefined): ts.SourceFile {\n while (node && node.kind != ts.SyntaxKind.SourceFile) {\n node = node.parent;\n }\n return <ts.SourceFile>node;\n}\n\n/* @internal */\nexport function sourceInfo(\n node: ts.Node | undefined, sourceFile: ts.SourceFile | undefined): MetadataSourceLocationInfo {\n if (node) {\n sourceFile = sourceFile || getSourceFileOfNode(node);\n if (sourceFile) {\n return ts.getLineAndCharacterOfPosition(sourceFile, node.getStart(sourceFile));\n }\n }\n return {};\n}\n\n/* @internal */\nexport function errorSymbol(\n message: string, node?: ts.Node, context?: {[name: string]: string},\n sourceFile?: ts.SourceFile): MetadataError {\n const result: MetadataError = {__symbolic: 'error', message, ...sourceInfo(node, sourceFile)};\n if (context) {\n result.context = context;\n }\n return result;\n}\n\n/**\n * Produce a symbolic representation of an expression folding values into their final value when\n * possible.\n */\nexport class Evaluator {\n constructor(\n private symbols: Symbols, private nodeMap: Map<MetadataEntry, ts.Node>,\n private options: CollectorOptions = {},\n private recordExport?: (name: string, value: MetadataValue) => void) {}\n\n nameOf(node: ts.Node|undefined): string|MetadataError {\n if (node && node.kind == ts.SyntaxKind.Identifier) {\n return (<ts.Identifier>node).text;\n }\n const result = node && this.evaluateNode(node);\n if (isMetadataError(result) || typeof result === 'string') {\n return result;\n } else {\n return errorSymbol(\n 'Name expected', node, {received: (node && node.getText()) || '<missing>'});\n }\n }\n\n /**\n * Returns true if the expression represented by `node` can be folded into a literal expression.\n *\n * For example, a literal is always foldable. This means that literal expressions such as `1.2`\n * `\"Some value\"` `true` `false` are foldable.\n *\n * - An object literal is foldable if all the properties in the literal are foldable.\n * - An array literal is foldable if all the elements are foldable.\n * - A call is foldable if it is a call to a Array.prototype.concat or a call to CONST_EXPR.\n * - A property access is foldable if the object is foldable.\n * - A array index is foldable if index expression is foldable and the array is foldable.\n * - Binary operator expressions are foldable if the left and right expressions are foldable and\n * it is one of '+', '-', '*', '/', '%', '||', and '&&'.\n * - An identifier is foldable if a value can be found for its symbol in the evaluator symbol\n * table.\n */\n public isFoldable(node: ts.Node): boolean {\n return this.isFoldableWorker(node, new Map<ts.Node, boolean>());\n }\n\n private isFoldableWorker(node: ts.Node|undefined, folding: Map<ts.Node, boolean>): boolean {\n if (node) {\n switch (node.kind) {\n case ts.SyntaxKind.ObjectLiteralExpression:\n return everyNodeChild(node, child => {\n if (child.kind === ts.SyntaxKind.PropertyAssignment) {\n const propertyAssignment = <ts.PropertyAssignment>child;\n return this.isFoldableWorker(propertyAssignment.initializer, folding);\n }\n return false;\n });\n case ts.SyntaxKind.ArrayLiteralExpression:\n return everyNodeChild(node, child => this.isFoldableWorker(child, folding));\n case ts.SyntaxKind.CallExpression:\n const callExpression = <ts.CallExpression>node;\n // We can fold a <array>.concat(<v>).\n if (isMethodCallOf(callExpression, 'concat') &&\n arrayOrEmpty(callExpression.arguments).length === 1) {\n const arrayNode = (<ts.PropertyAccessExpression>callExpression.expression).expression;\n if (this.isFoldableWorker(arrayNode, folding) &&\n this.isFoldableWorker(callExpression.arguments[0], folding)) {\n // It needs to be an array.\n const arrayValue = this.evaluateNode(arrayNode);\n if (arrayValue && Array.isArray(arrayValue)) {\n return true;\n }\n }\n }\n\n // We can fold a call to CONST_EXPR\n if (isCallOf(callExpression, 'CONST_EXPR') &&\n arrayOrEmpty(callExpression.arguments).length === 1)\n return this.isFoldableWorker(callExpression.arguments[0], folding);\n return false;\n case ts.SyntaxKind.NoSubstitutionTemplateLiteral:\n case ts.SyntaxKind.StringLiteral:\n case ts.SyntaxKind.NumericLiteral:\n case ts.SyntaxKind.NullKeyword:\n case ts.SyntaxKind.TrueKeyword:\n case ts.SyntaxKind.FalseKeyword:\n case ts.SyntaxKind.TemplateHead:\n case ts.SyntaxKind.TemplateMiddle:\n case ts.SyntaxKind.TemplateTail:\n return true;\n case ts.SyntaxKind.ParenthesizedExpression:\n const parenthesizedExpression = <ts.ParenthesizedExpression>node;\n return this.isFoldableWorker(parenthesizedExpression.expression, folding);\n case ts.SyntaxKind.BinaryExpression:\n const binaryExpression = <ts.BinaryExpression>node;\n switch (binaryExpression.operatorToken.kind) {\n case ts.SyntaxKind.PlusToken:\n case ts.SyntaxKind.MinusToken:\n case ts.SyntaxKind.AsteriskToken:\n case ts.SyntaxKind.SlashToken:\n case ts.SyntaxKind.PercentToken:\n case ts.SyntaxKind.AmpersandAmpersandToken:\n case ts.SyntaxKind.BarBarToken:\n return this.isFoldableWorker(binaryExpression.left, folding) &&\n this.isFoldableWorker(binaryExpression.right, folding);\n default:\n return false;\n }\n case ts.SyntaxKind.PropertyAccessExpression:\n const propertyAccessExpression = <ts.PropertyAccessExpression>node;\n return this.isFoldableWorker(propertyAccessExpression.expression, folding);\n case ts.SyntaxKind.ElementAccessExpression:\n const elementAccessExpression = <ts.ElementAccessExpression>node;\n return this.isFoldableWorker(elementAccessExpression.expression, folding) &&\n this.isFoldableWorker(elementAccessExpression.argumentExpression, folding);\n case ts.SyntaxKind.Identifier:\n let identifier = <ts.Identifier>node;\n let reference = this.symbols.resolve(identifier.text);\n if (reference !== undefined && isPrimitive(reference)) {\n return true;\n }\n break;\n case ts.SyntaxKind.TemplateExpression:\n const templateExpression = <ts.TemplateExpression>node;\n return templateExpression.templateSpans.every(\n span => this.isFoldableWorker(span.expression, folding));\n }\n }\n return false;\n }\n\n /**\n * Produce a JSON serialiable object representing `node`. The foldable values in the expression\n * tree are folded. For example, a node representing `1 + 2` is folded into `3`.\n */\n public evaluateNode(node: ts.Node, preferReference?: boolean): MetadataValue {\n const t = this;\n let error: MetadataError|undefined;\n\n function recordEntry(entry: MetadataValue, node: ts.Node): MetadataValue {\n if (t.options.substituteExpression) {\n const newEntry = t.options.substituteExpression(entry, node);\n if (t.recordExport && newEntry != entry && isMetadataGlobalReferenceExpression(newEntry)) {\n t.recordExport(newEntry.name, entry);\n }\n entry = newEntry;\n }\n return recordMapEntry(entry, node, t.nodeMap);\n }\n\n function isFoldableError(value: any): value is MetadataError {\n return !t.options.verboseInvalidExpression && isMetadataError(value);\n }\n\n const resolveName = (name: string, preferReference?: boolean): MetadataValue => {\n const reference = this.symbols.resolve(name, preferReference);\n if (reference === undefined) {\n // Encode as a global reference. StaticReflector will check the reference.\n return recordEntry({__symbolic: 'reference', name}, node);\n }\n if (reference && isMetadataSymbolicReferenceExpression(reference)) {\n return recordEntry({...reference}, node);\n }\n return reference;\n };\n\n switch (node.kind) {\n case ts.SyntaxKind.ObjectLiteralExpression:\n let obj: {[name: string]: any} = {};\n let quoted: string[] = [];\n ts.forEachChild(node, child => {\n switch (child.kind) {\n case ts.SyntaxKind.ShorthandPropertyAssignment:\n case ts.SyntaxKind.PropertyAssignment:\n const assignment = <ts.PropertyAssignment|ts.ShorthandPropertyAssignment>child;\n if (assignment.name.kind == ts.SyntaxKind.StringLiteral) {\n const name = (assignment.name as ts.StringLiteral).text;\n quoted.push(name);\n }\n const propertyName = this.nameOf(assignment.name);\n if (isFoldableError(propertyName)) {\n error = propertyName;\n return true;\n }\n const propertyValue = isPropertyAssignment(assignment) ?\n this.evaluateNode(assignment.initializer, /* preferReference */ true) :\n resolveName(propertyName, /* preferReference */ true);\n if (isFoldableError(propertyValue)) {\n error = propertyValue;\n return true; // Stop the forEachChild.\n } else {\n obj[<string>propertyName] = isPropertyAssignment(assignment) ?\n recordEntry(propertyValue, assignment.initializer) :\n propertyValue;\n }\n }\n });\n if (error) return error;\n if (this.options.quotedNames && quoted.length) {\n obj['$quoted$'] = quoted;\n }\n return recordEntry(obj, node);\n case ts.SyntaxKind.ArrayLiteralExpression:\n let arr: MetadataValue[] = [];\n ts.forEachChild(node, child => {\n const value = this.evaluateNode(child, /* preferReference */ true);\n\n // Check for error\n if (isFoldableError(value)) {\n error = value;\n return true; // Stop the forEachChild.\n }\n\n // Handle spread expressions\n if (isMetadataSymbolicSpreadExpression(value)) {\n if (Array.isArray(value.expression)) {\n for (const spreadValue of value.expression) {\n arr.push(spreadValue);\n }\n return;\n }\n }\n\n arr.push(value);\n });\n if (error) return error;\n return recordEntry(arr, node);\n case spreadElementSyntaxKind:\n let spreadExpression = this.evaluateNode((node as any).expression);\n return recordEntry({__symbolic: 'spread', expression: spreadExpression}, node);\n case ts.SyntaxKind.CallExpression:\n const callExpression = <ts.CallExpression>node;\n if (isCallOf(callExpression, 'forwardRef') &&\n arrayOrEmpty(callExpression.arguments).length === 1) {\n const firstArgument = callExpression.arguments[0];\n if (firstArgument.kind == ts.SyntaxKind.ArrowFunction) {\n const arrowFunction = <ts.ArrowFunction>firstArgument;\n return recordEntry(this.evaluateNode(arrowFunction.body), node);\n }\n }\n const args = arrayOrEmpty(callExpression.arguments).map(arg => this.evaluateNode(arg));\n if (!this.options.verboseInvalidExpression && args.some(isMetadataError)) {\n return args.find(isMetadataError);\n }\n if (this.isFoldable(callExpression)) {\n if (isMethodCallOf(callExpression, 'concat')) {\n const arrayValue = <MetadataValue[]>this.evaluateNode(\n (<ts.PropertyAccessExpression>callExpression.expression).expression);\n if (isFoldableError(arrayValue)) return arrayValue;\n return arrayValue.concat(args[0]);\n }\n }\n // Always fold a CONST_EXPR even if the argument is not foldable.\n if (isCallOf(callExpression, 'CONST_EXPR') &&\n arrayOrEmpty(callExpression.arguments).length === 1) {\n return recordEntry(args[0], node);\n }\n const expression = this.evaluateNode(callExpression.expression);\n if (isFoldableError(expression)) {\n return recordEntry(expression, node);\n }\n let result: MetadataSymbolicCallExpression = {__symbolic: 'call', expression: expression};\n if (args && args.length) {\n result.arguments = args;\n }\n return recordEntry(result, node);\n case ts.SyntaxKind.NewExpression:\n const newExpression = <ts.NewExpression>node;\n const newArgs = arrayOrEmpty(newExpression.arguments).map(arg => this.evaluateNode(arg));\n if (!this.options.verboseInvalidExpression && newArgs.some(isMetadataError)) {\n return recordEntry(newArgs.find(isMetadataError), node);\n }\n const newTarget = this.evaluateNode(newExpression.expression);\n if (isMetadataError(newTarget)) {\n return recordEntry(newTarget, node);\n }\n const call: MetadataSymbolicCallExpression = {__symbolic: 'new', expression: newTarget};\n if (newArgs.length) {\n call.arguments = newArgs;\n }\n return recordEntry(call, node);\n case ts.SyntaxKind.PropertyAccessExpression: {\n const propertyAccessExpression = <ts.PropertyAccessExpression>node;\n const expression = this.evaluateNode(propertyAccessExpression.expression);\n if (isFoldableError(expression)) {\n return recordEntry(expression, node);\n }\n const member = this.nameOf(propertyAccessExpression.name);\n if (isFoldableError(member)) {\n return recordEntry(member, node);\n }\n if (expression && this.isFoldable(propertyAccessExpression.expression))\n return (<any>expression)[<string>member];\n if (isMetadataModuleReferenceExpression(expression)) {\n // A select into a module reference and be converted into a reference to the symbol\n // in the module\n return recordEntry(\n {__symbolic: 'reference', module: expression.module, name: member}, node);\n }\n return recordEntry({__symbolic: 'select', expression, member}, node);\n }\n case ts.SyntaxKind.ElementAccessExpression: {\n const elementAccessExpression = <ts.ElementAccessExpression>node;\n const expression = this.evaluateNode(elementAccessExpression.expression);\n if (isFoldableError(expression)) {\n return recordEntry(expression, node);\n }\n if (!elementAccessExpression.argumentExpression) {\n return recordEntry(errorSymbol('Expression form not supported', node), node);\n }\n const index = this.evaluateNode(elementAccessExpression.argumentExpression);\n if (isFoldableError(expression)) {\n return recordEntry(expression, node);\n }\n if (this.isFoldable(elementAccessExpression.expression) &&\n this.isFoldable(elementAccessExpression.argumentExpression))\n return (<any>expression)[<string|number>index];\n return recordEntry({__symbolic: 'index', expression, index}, node);\n }\n case ts.SyntaxKind.Identifier:\n const identifier = <ts.Identifier>node;\n const name = identifier.text;\n return resolveName(name, preferReference);\n case ts.SyntaxKind.TypeReference:\n const typeReferenceNode = <ts.TypeReferenceNode>node;\n const typeNameNode = typeReferenceNode.typeName;\n const getReference: (typeNameNode: ts.Identifier | ts.QualifiedName) => MetadataValue =\n node => {\n if (typeNameNode.kind === ts.SyntaxKind.QualifiedName) {\n const qualifiedName = <ts.QualifiedName>node;\n const left = this.evaluateNode(qualifiedName.left);\n if (isMetadataModuleReferenceExpression(left)) {\n return recordEntry(\n <MetadataImportedSymbolReferenceExpression>{\n __symbolic: 'reference',\n module: left.module,\n name: qualifiedName.right.text\n },\n node);\n }\n // Record a type reference to a declared type as a select.\n return {__symbolic: 'select', expression: left, member: qualifiedName.right.text};\n } else {\n const identifier = <ts.Identifier>typeNameNode;\n const symbol = this.symbols.resolve(identifier.text);\n if (isFoldableError(symbol) || isMetadataSymbolicReferenceExpression(symbol)) {\n return recordEntry(symbol, node);\n }\n return recordEntry(\n errorSymbol('Could not resolve type', node, {typeName: identifier.text}), node);\n }\n };\n const typeReference = getReference(typeNameNode);\n if (isFoldableError(typeReference)) {\n return recordEntry(typeReference, node);\n }\n if (!isMetadataModuleReferenceExpression(typeReference) &&\n typeReferenceNode.typeArguments && typeReferenceNode.typeArguments.length) {\n const args = typeReferenceNode.typeArguments.map(element => this.evaluateNode(element));\n // TODO: Remove typecast when upgraded to 2.0 as it will be corretly inferred.\n // Some versions of 1.9 do not infer this correctly.\n (<MetadataImportedSymbolReferenceExpression>typeReference).arguments = args;\n }\n return recordEntry(typeReference, node);\n case ts.SyntaxKind.UnionType:\n const unionType = <ts.UnionTypeNode>node;\n\n // Remove null and undefined from the list of unions.\n const references = unionType.types\n .filter(\n n => n.kind != ts.SyntaxKind.NullKeyword &&\n n.kind != ts.SyntaxKind.UndefinedKeyword)\n .map(n => this.evaluateNode(n));\n\n // The remmaining reference must be the same. If two have type arguments consider them\n // different even if the type arguments are the same.\n let candidate: any = null;\n for (let i = 0; i < references.length; i++) {\n const reference = references[i];\n if (isMetadataSymbolicReferenceExpression(reference)) {\n if (candidate) {\n if ((reference as any).name == candidate.name &&\n (reference as any).module == candidate.module && !(reference as any).arguments) {\n candidate = reference;\n }\n } else {\n candidate = reference;\n }\n } else {\n return reference;\n }\n }\n if (candidate) return candidate;\n break;\n case ts.SyntaxKind.NoSubstitutionTemplateLiteral:\n case ts.SyntaxKind.StringLiteral:\n case ts.SyntaxKind.TemplateHead:\n case ts.SyntaxKind.TemplateTail:\n case ts.SyntaxKind.TemplateMiddle:\n return (<ts.LiteralLikeNode>node).text;\n case ts.SyntaxKind.NumericLiteral:\n return parseFloat((<ts.LiteralExpression>node).text);\n case ts.SyntaxKind.AnyKeyword:\n return recordEntry({__symbolic: 'reference', name: 'any'}, node);\n case ts.SyntaxKind.StringKeyword:\n return recordEntry({__symbolic: 'reference', name: 'string'}, node);\n case ts.SyntaxKind.NumberKeyword:\n return recordEntry({__symbolic: 'reference', name: 'number'}, node);\n case ts.SyntaxKind.BooleanKeyword:\n return recordEntry({__symbolic: 'reference', name: 'boolean'}, node);\n case ts.SyntaxKind.ArrayType:\n const arrayTypeNode = <ts.ArrayTypeNode>node;\n return recordEntry(\n {\n __symbolic: 'reference',\n name: 'Array',\n arguments: [this.evaluateNode(arrayTypeNode.elementType)]\n },\n node);\n case ts.SyntaxKind.NullKeyword:\n return null;\n case ts.SyntaxKind.TrueKeyword:\n return true;\n case ts.SyntaxKind.FalseKeyword:\n return false;\n case ts.SyntaxKind.ParenthesizedExpression:\n const parenthesizedExpression = <ts.ParenthesizedExpression>node;\n return this.evaluateNode(parenthesizedExpression.expression);\n case ts.SyntaxKind.TypeAssertionExpression:\n const typeAssertion = <ts.TypeAssertion>node;\n return this.evaluateNode(typeAssertion.expression);\n case ts.SyntaxKind.PrefixUnaryExpression:\n const prefixUnaryExpression = <ts.PrefixUnaryExpression>node;\n const operand = this.evaluateNode(prefixUnaryExpression.operand);\n if (isDefined(operand) && isPrimitive(operand)) {\n switch (prefixUnaryExpression.operator) {\n case ts.SyntaxKind.PlusToken:\n return +(operand as any);\n case ts.SyntaxKind.MinusToken:\n return -(operand as any);\n case ts.SyntaxKind.TildeToken:\n return ~(operand as any);\n case ts.SyntaxKind.ExclamationToken:\n return !operand;\n }\n }\n let operatorText: string;\n switch (prefixUnaryExpression.operator) {\n case ts.SyntaxKind.PlusToken:\n operatorText = '+';\n break;\n case ts.SyntaxKind.MinusToken:\n operatorText = '-';\n break;\n case ts.SyntaxKind.TildeToken:\n operatorText = '~';\n break;\n case ts.SyntaxKind.ExclamationToken:\n operatorText = '!';\n break;\n default:\n return undefined;\n }\n return recordEntry({__symbolic: 'pre', operator: operatorText, operand: operand}, node);\n case ts.SyntaxKind.BinaryExpression:\n const binaryExpression = <ts.BinaryExpression>node;\n const left = this.evaluateNode(binaryExpression.left);\n const right = this.evaluateNode(binaryExpression.right);\n if (isDefined(left) && isDefined(right)) {\n if (isPrimitive(left) && isPrimitive(right))\n switch (binaryExpression.operatorToken.kind) {\n case ts.SyntaxKind.BarBarToken:\n return <any>left || <any>right;\n case ts.SyntaxKind.AmpersandAmpersandToken:\n return <any>left && <any>right;\n case ts.SyntaxKind.AmpersandToken:\n return <any>left & <any>right;\n case ts.SyntaxKind.BarToken:\n return <any>left | <any>right;\n case ts.SyntaxKind.CaretToken:\n return <any>left ^ <any>right;\n case ts.SyntaxKind.EqualsEqualsToken:\n return <any>left == <any>right;\n case ts.SyntaxKind.ExclamationEqualsToken:\n return <any>left != <any>right;\n case ts.SyntaxKind.EqualsEqualsEqualsToken:\n return <any>left === <any>right;\n case ts.SyntaxKind.ExclamationEqualsEqualsToken:\n return <any>left !== <any>right;\n case ts.SyntaxKind.LessThanToken:\n return <any>left < <any>right;\n case ts.SyntaxKind.GreaterThanToken:\n return <any>left > <any>right;\n case ts.SyntaxKind.LessThanEqualsToken:\n return <any>left <= <any>right;\n case ts.SyntaxKind.GreaterThanEqualsToken:\n return <any>left >= <any>right;\n case ts.SyntaxKind.LessThanLessThanToken:\n return (<any>left) << (<any>right);\n case ts.SyntaxKind.GreaterThanGreaterThanToken:\n return <any>left >> <any>right;\n case ts.SyntaxKind.GreaterThanGreaterThanGreaterThanToken:\n return <any>left >>> <any>right;\n case ts.SyntaxKind.PlusToken:\n return <any>left + <any>right;\n case ts.SyntaxKind.MinusToken:\n return <any>left - <any>right;\n case ts.SyntaxKind.AsteriskToken:\n return <any>left * <any>right;\n case ts.SyntaxKind.SlashToken:\n return <any>left / <any>right;\n case ts.SyntaxKind.PercentToken:\n return <any>left % <any>right;\n }\n return recordEntry(\n {\n __symbolic: 'binop',\n operator: binaryExpression.operatorToken.getText(),\n left: left,\n right: right\n },\n node);\n }\n break;\n case ts.SyntaxKind.ConditionalExpression:\n const conditionalExpression = <ts.ConditionalExpression>node;\n const condition = this.evaluateNode(conditionalExpression.condition);\n const thenExpression = this.evaluateNode(conditionalExpression.whenTrue);\n const elseExpression = this.evaluateNode(conditionalExpression.whenFalse);\n if (isPrimitive(condition)) {\n return condition ? thenExpression : elseExpression;\n }\n return recordEntry({__symbolic: 'if', condition, thenExpression, elseExpression}, node);\n case ts.SyntaxKind.FunctionExpression:\n case ts.SyntaxKind.ArrowFunction:\n return recordEntry(errorSymbol('Lambda not supported', node), node);\n case ts.SyntaxKind.TaggedTemplateExpression:\n return recordEntry(\n errorSymbol('Tagged template expressions are not supported in metadata', node), node);\n case ts.SyntaxKind.TemplateExpression:\n const templateExpression = <ts.TemplateExpression>node;\n if (this.isFoldable(node)) {\n return templateExpression.templateSpans.reduce(\n (previous, current) => previous + <string>this.evaluateNode(current.expression) +\n <string>this.evaluateNode(current.literal),\n this.evaluateNode(templateExpression.head));\n } else {\n return templateExpression.templateSpans.reduce((previous, current) => {\n const expr = this.evaluateNode(current.expression);\n const literal = this.evaluateNode(current.literal);\n if (isFoldableError(expr)) return expr;\n if (isFoldableError(literal)) return literal;\n if (typeof previous === 'string' && typeof expr === 'string' &&\n typeof literal === 'string') {\n return previous + expr + literal;\n }\n let result = expr;\n if (previous !== '') {\n result = {__symbolic: 'binop', operator: '+', left: previous, right: expr};\n }\n if (literal != '') {\n result = {__symbolic: 'binop', operator: '+', left: result, right: literal};\n }\n return result;\n }, this.evaluateNode(templateExpression.head));\n }\n case ts.SyntaxKind.AsExpression:\n const asExpression = <ts.AsExpression>node;\n return this.evaluateNode(asExpression.expression);\n case ts.SyntaxKind.ClassExpression:\n return {__symbolic: 'class'};\n }\n return recordEntry(errorSymbol('Expression form not supported', node), node);\n }\n}\n\nfunction isPropertyAssignment(node: ts.Node): node is ts.PropertyAssignment {\n return node.kind == ts.SyntaxKind.PropertyAssignment;\n}\n\nconst empty = ts.createNodeArray<any>();\n\nfunction arrayOrEmpty<T extends ts.Node>(v: ts.NodeArray<T>| undefined): ts.NodeArray<T> {\n return v || empty;\n}"]}
|
|
1
|
+
{"version":3,"file":"evaluator.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/metadata/evaluator.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;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C7B,IAAM,YAAY,GAAoB,IAAI,CAAC;gBAC3C,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YACpD,KAAK,EAAE,CAAC,UAAU,CAAC,eAAe;gBAChC,MAAM,CAAC,EAAC,UAAU,EAAE,OAAO,EAAC,CAAC;QACjC,CAAC;QACD,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,+BAA+B,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAC/E,CAAC;IACH,gBAAC;AAAD,CAAC,AApjBD,IAojBC;AApjBY,8BAAS;AAsjBtB,8BAA8B,IAAa;IACzC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC;AACvD,CAAC;AAED,IAAM,KAAK,GAAG,EAAE,CAAC,eAAe,EAAO,CAAC;AAExC,sBAAyC,CAA6B;IACpE,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC;AACpB,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport * as ts from 'typescript';\n\nimport {CollectorOptions} from './collector';\nimport {ClassMetadata, FunctionMetadata, InterfaceMetadata, MetadataEntry, MetadataError, MetadataImportedSymbolReferenceExpression, MetadataSourceLocationInfo, MetadataSymbolicCallExpression, MetadataValue, isMetadataError, isMetadataGlobalReferenceExpression, isMetadataImportDefaultReference, isMetadataImportedSymbolReferenceExpression, isMetadataModuleReferenceExpression, isMetadataSymbolicReferenceExpression, isMetadataSymbolicSpreadExpression} from './schema';\nimport {Symbols} from './symbols';\n\n\n\n// In TypeScript 2.1 the spread element kind was renamed.\nconst spreadElementSyntaxKind: ts.SyntaxKind =\n (ts.SyntaxKind as any).SpreadElement || (ts.SyntaxKind as any).SpreadElementExpression;\n\nfunction isMethodCallOf(callExpression: ts.CallExpression, memberName: string): boolean {\n const expression = callExpression.expression;\n if (expression.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const propertyAccessExpression = <ts.PropertyAccessExpression>expression;\n const name = propertyAccessExpression.name;\n if (name.kind == ts.SyntaxKind.Identifier) {\n return name.text === memberName;\n }\n }\n return false;\n}\n\nfunction isCallOf(callExpression: ts.CallExpression, ident: string): boolean {\n const expression = callExpression.expression;\n if (expression.kind === ts.SyntaxKind.Identifier) {\n const identifier = <ts.Identifier>expression;\n return identifier.text === ident;\n }\n return false;\n}\n\n/* @internal */\nexport function recordMapEntry<T extends MetadataEntry>(\n entry: T, node: ts.Node,\n nodeMap: Map<MetadataValue|ClassMetadata|InterfaceMetadata|FunctionMetadata, ts.Node>,\n sourceFile?: ts.SourceFile) {\n if (!nodeMap.has(entry)) {\n nodeMap.set(entry, node);\n if (node && (isMetadataImportedSymbolReferenceExpression(entry) ||\n isMetadataImportDefaultReference(entry)) &&\n entry.line == null) {\n const info = sourceInfo(node, sourceFile);\n if (info.line != null) entry.line = info.line;\n if (info.character != null) entry.character = info.character;\n }\n }\n return entry;\n}\n\n/**\n * ts.forEachChild stops iterating children when the callback return a truthy value.\n * This method inverts this to implement an `every` style iterator. It will return\n * true if every call to `cb` returns `true`.\n */\nfunction everyNodeChild(node: ts.Node, cb: (node: ts.Node) => boolean) {\n return !ts.forEachChild(node, node => !cb(node));\n}\n\nexport function isPrimitive(value: any): boolean {\n return Object(value) !== value;\n}\n\nfunction isDefined(obj: any): boolean {\n return obj !== undefined;\n}\n\n// import {propertyName as name} from 'place'\n// import {name} from 'place'\nexport interface ImportSpecifierMetadata {\n name: string;\n propertyName?: string;\n}\nexport interface ImportMetadata {\n defaultName?: string; // import d from 'place'\n namespace?: string; // import * as d from 'place'\n namedImports?: ImportSpecifierMetadata[]; // import {a} from 'place'\n from: string; // from 'place'\n}\n\n\nfunction getSourceFileOfNode(node: ts.Node | undefined): ts.SourceFile {\n while (node && node.kind != ts.SyntaxKind.SourceFile) {\n node = node.parent;\n }\n return <ts.SourceFile>node;\n}\n\n/* @internal */\nexport function sourceInfo(\n node: ts.Node | undefined, sourceFile: ts.SourceFile | undefined): MetadataSourceLocationInfo {\n if (node) {\n sourceFile = sourceFile || getSourceFileOfNode(node);\n if (sourceFile) {\n return ts.getLineAndCharacterOfPosition(sourceFile, node.getStart(sourceFile));\n }\n }\n return {};\n}\n\n/* @internal */\nexport function errorSymbol(\n message: string, node?: ts.Node, context?: {[name: string]: string},\n sourceFile?: ts.SourceFile): MetadataError {\n const result: MetadataError = {__symbolic: 'error', message, ...sourceInfo(node, sourceFile)};\n if (context) {\n result.context = context;\n }\n return result;\n}\n\n/**\n * Produce a symbolic representation of an expression folding values into their final value when\n * possible.\n */\nexport class Evaluator {\n constructor(\n private symbols: Symbols, private nodeMap: Map<MetadataEntry, ts.Node>,\n private options: CollectorOptions = {},\n private recordExport?: (name: string, value: MetadataValue) => void) {}\n\n nameOf(node: ts.Node|undefined): string|MetadataError {\n if (node && node.kind == ts.SyntaxKind.Identifier) {\n return (<ts.Identifier>node).text;\n }\n const result = node && this.evaluateNode(node);\n if (isMetadataError(result) || typeof result === 'string') {\n return result;\n } else {\n return errorSymbol(\n 'Name expected', node, {received: (node && node.getText()) || '<missing>'});\n }\n }\n\n /**\n * Returns true if the expression represented by `node` can be folded into a literal expression.\n *\n * For example, a literal is always foldable. This means that literal expressions such as `1.2`\n * `\"Some value\"` `true` `false` are foldable.\n *\n * - An object literal is foldable if all the properties in the literal are foldable.\n * - An array literal is foldable if all the elements are foldable.\n * - A call is foldable if it is a call to a Array.prototype.concat or a call to CONST_EXPR.\n * - A property access is foldable if the object is foldable.\n * - A array index is foldable if index expression is foldable and the array is foldable.\n * - Binary operator expressions are foldable if the left and right expressions are foldable and\n * it is one of '+', '-', '*', '/', '%', '||', and '&&'.\n * - An identifier is foldable if a value can be found for its symbol in the evaluator symbol\n * table.\n */\n public isFoldable(node: ts.Node): boolean {\n return this.isFoldableWorker(node, new Map<ts.Node, boolean>());\n }\n\n private isFoldableWorker(node: ts.Node|undefined, folding: Map<ts.Node, boolean>): boolean {\n if (node) {\n switch (node.kind) {\n case ts.SyntaxKind.ObjectLiteralExpression:\n return everyNodeChild(node, child => {\n if (child.kind === ts.SyntaxKind.PropertyAssignment) {\n const propertyAssignment = <ts.PropertyAssignment>child;\n return this.isFoldableWorker(propertyAssignment.initializer, folding);\n }\n return false;\n });\n case ts.SyntaxKind.ArrayLiteralExpression:\n return everyNodeChild(node, child => this.isFoldableWorker(child, folding));\n case ts.SyntaxKind.CallExpression:\n const callExpression = <ts.CallExpression>node;\n // We can fold a <array>.concat(<v>).\n if (isMethodCallOf(callExpression, 'concat') &&\n arrayOrEmpty(callExpression.arguments).length === 1) {\n const arrayNode = (<ts.PropertyAccessExpression>callExpression.expression).expression;\n if (this.isFoldableWorker(arrayNode, folding) &&\n this.isFoldableWorker(callExpression.arguments[0], folding)) {\n // It needs to be an array.\n const arrayValue = this.evaluateNode(arrayNode);\n if (arrayValue && Array.isArray(arrayValue)) {\n return true;\n }\n }\n }\n\n // We can fold a call to CONST_EXPR\n if (isCallOf(callExpression, 'CONST_EXPR') &&\n arrayOrEmpty(callExpression.arguments).length === 1)\n return this.isFoldableWorker(callExpression.arguments[0], folding);\n return false;\n case ts.SyntaxKind.NoSubstitutionTemplateLiteral:\n case ts.SyntaxKind.StringLiteral:\n case ts.SyntaxKind.NumericLiteral:\n case ts.SyntaxKind.NullKeyword:\n case ts.SyntaxKind.TrueKeyword:\n case ts.SyntaxKind.FalseKeyword:\n case ts.SyntaxKind.TemplateHead:\n case ts.SyntaxKind.TemplateMiddle:\n case ts.SyntaxKind.TemplateTail:\n return true;\n case ts.SyntaxKind.ParenthesizedExpression:\n const parenthesizedExpression = <ts.ParenthesizedExpression>node;\n return this.isFoldableWorker(parenthesizedExpression.expression, folding);\n case ts.SyntaxKind.BinaryExpression:\n const binaryExpression = <ts.BinaryExpression>node;\n switch (binaryExpression.operatorToken.kind) {\n case ts.SyntaxKind.PlusToken:\n case ts.SyntaxKind.MinusToken:\n case ts.SyntaxKind.AsteriskToken:\n case ts.SyntaxKind.SlashToken:\n case ts.SyntaxKind.PercentToken:\n case ts.SyntaxKind.AmpersandAmpersandToken:\n case ts.SyntaxKind.BarBarToken:\n return this.isFoldableWorker(binaryExpression.left, folding) &&\n this.isFoldableWorker(binaryExpression.right, folding);\n default:\n return false;\n }\n case ts.SyntaxKind.PropertyAccessExpression:\n const propertyAccessExpression = <ts.PropertyAccessExpression>node;\n return this.isFoldableWorker(propertyAccessExpression.expression, folding);\n case ts.SyntaxKind.ElementAccessExpression:\n const elementAccessExpression = <ts.ElementAccessExpression>node;\n return this.isFoldableWorker(elementAccessExpression.expression, folding) &&\n this.isFoldableWorker(elementAccessExpression.argumentExpression, folding);\n case ts.SyntaxKind.Identifier:\n let identifier = <ts.Identifier>node;\n let reference = this.symbols.resolve(identifier.text);\n if (reference !== undefined && isPrimitive(reference)) {\n return true;\n }\n break;\n case ts.SyntaxKind.TemplateExpression:\n const templateExpression = <ts.TemplateExpression>node;\n return templateExpression.templateSpans.every(\n span => this.isFoldableWorker(span.expression, folding));\n }\n }\n return false;\n }\n\n /**\n * Produce a JSON serialiable object representing `node`. The foldable values in the expression\n * tree are folded. For example, a node representing `1 + 2` is folded into `3`.\n */\n public evaluateNode(node: ts.Node, preferReference?: boolean): MetadataValue {\n const t = this;\n let error: MetadataError|undefined;\n\n function recordEntry(entry: MetadataValue, node: ts.Node): MetadataValue {\n if (t.options.substituteExpression) {\n const newEntry = t.options.substituteExpression(entry, node);\n if (t.recordExport && newEntry != entry && isMetadataGlobalReferenceExpression(newEntry)) {\n t.recordExport(newEntry.name, entry);\n }\n entry = newEntry;\n }\n return recordMapEntry(entry, node, t.nodeMap);\n }\n\n function isFoldableError(value: any): value is MetadataError {\n return !t.options.verboseInvalidExpression && isMetadataError(value);\n }\n\n const resolveName = (name: string, preferReference?: boolean): MetadataValue => {\n const reference = this.symbols.resolve(name, preferReference);\n if (reference === undefined) {\n // Encode as a global reference. StaticReflector will check the reference.\n return recordEntry({__symbolic: 'reference', name}, node);\n }\n if (reference && isMetadataSymbolicReferenceExpression(reference)) {\n return recordEntry({...reference}, node);\n }\n return reference;\n };\n\n switch (node.kind) {\n case ts.SyntaxKind.ObjectLiteralExpression:\n let obj: {[name: string]: any} = {};\n let quoted: string[] = [];\n ts.forEachChild(node, child => {\n switch (child.kind) {\n case ts.SyntaxKind.ShorthandPropertyAssignment:\n case ts.SyntaxKind.PropertyAssignment:\n const assignment = <ts.PropertyAssignment|ts.ShorthandPropertyAssignment>child;\n if (assignment.name.kind == ts.SyntaxKind.StringLiteral) {\n const name = (assignment.name as ts.StringLiteral).text;\n quoted.push(name);\n }\n const propertyName = this.nameOf(assignment.name);\n if (isFoldableError(propertyName)) {\n error = propertyName;\n return true;\n }\n const propertyValue = isPropertyAssignment(assignment) ?\n this.evaluateNode(assignment.initializer, /* preferReference */ true) :\n resolveName(propertyName, /* preferReference */ true);\n if (isFoldableError(propertyValue)) {\n error = propertyValue;\n return true; // Stop the forEachChild.\n } else {\n obj[<string>propertyName] = isPropertyAssignment(assignment) ?\n recordEntry(propertyValue, assignment.initializer) :\n propertyValue;\n }\n }\n });\n if (error) return error;\n if (this.options.quotedNames && quoted.length) {\n obj['$quoted$'] = quoted;\n }\n return recordEntry(obj, node);\n case ts.SyntaxKind.ArrayLiteralExpression:\n let arr: MetadataValue[] = [];\n ts.forEachChild(node, child => {\n const value = this.evaluateNode(child, /* preferReference */ true);\n\n // Check for error\n if (isFoldableError(value)) {\n error = value;\n return true; // Stop the forEachChild.\n }\n\n // Handle spread expressions\n if (isMetadataSymbolicSpreadExpression(value)) {\n if (Array.isArray(value.expression)) {\n for (const spreadValue of value.expression) {\n arr.push(spreadValue);\n }\n return;\n }\n }\n\n arr.push(value);\n });\n if (error) return error;\n return recordEntry(arr, node);\n case spreadElementSyntaxKind:\n let spreadExpression = this.evaluateNode((node as any).expression);\n return recordEntry({__symbolic: 'spread', expression: spreadExpression}, node);\n case ts.SyntaxKind.CallExpression:\n const callExpression = <ts.CallExpression>node;\n if (isCallOf(callExpression, 'forwardRef') &&\n arrayOrEmpty(callExpression.arguments).length === 1) {\n const firstArgument = callExpression.arguments[0];\n if (firstArgument.kind == ts.SyntaxKind.ArrowFunction) {\n const arrowFunction = <ts.ArrowFunction>firstArgument;\n return recordEntry(this.evaluateNode(arrowFunction.body), node);\n }\n }\n const args = arrayOrEmpty(callExpression.arguments).map(arg => this.evaluateNode(arg));\n if (this.isFoldable(callExpression)) {\n if (isMethodCallOf(callExpression, 'concat')) {\n const arrayValue = <MetadataValue[]>this.evaluateNode(\n (<ts.PropertyAccessExpression>callExpression.expression).expression);\n if (isFoldableError(arrayValue)) return arrayValue;\n return arrayValue.concat(args[0]);\n }\n }\n // Always fold a CONST_EXPR even if the argument is not foldable.\n if (isCallOf(callExpression, 'CONST_EXPR') &&\n arrayOrEmpty(callExpression.arguments).length === 1) {\n return recordEntry(args[0], node);\n }\n const expression = this.evaluateNode(callExpression.expression);\n if (isFoldableError(expression)) {\n return recordEntry(expression, node);\n }\n let result: MetadataSymbolicCallExpression = {__symbolic: 'call', expression: expression};\n if (args && args.length) {\n result.arguments = args;\n }\n return recordEntry(result, node);\n case ts.SyntaxKind.NewExpression:\n const newExpression = <ts.NewExpression>node;\n const newArgs = arrayOrEmpty(newExpression.arguments).map(arg => this.evaluateNode(arg));\n if (!this.options.verboseInvalidExpression && newArgs.some(isMetadataError)) {\n return recordEntry(newArgs.find(isMetadataError), node);\n }\n const newTarget = this.evaluateNode(newExpression.expression);\n if (isMetadataError(newTarget)) {\n return recordEntry(newTarget, node);\n }\n const call: MetadataSymbolicCallExpression = {__symbolic: 'new', expression: newTarget};\n if (newArgs.length) {\n call.arguments = newArgs;\n }\n return recordEntry(call, node);\n case ts.SyntaxKind.PropertyAccessExpression: {\n const propertyAccessExpression = <ts.PropertyAccessExpression>node;\n const expression = this.evaluateNode(propertyAccessExpression.expression);\n if (isFoldableError(expression)) {\n return recordEntry(expression, node);\n }\n const member = this.nameOf(propertyAccessExpression.name);\n if (isFoldableError(member)) {\n return recordEntry(member, node);\n }\n if (expression && this.isFoldable(propertyAccessExpression.expression))\n return (<any>expression)[<string>member];\n if (isMetadataModuleReferenceExpression(expression)) {\n // A select into a module reference and be converted into a reference to the symbol\n // in the module\n return recordEntry(\n {__symbolic: 'reference', module: expression.module, name: member}, node);\n }\n return recordEntry({__symbolic: 'select', expression, member}, node);\n }\n case ts.SyntaxKind.ElementAccessExpression: {\n const elementAccessExpression = <ts.ElementAccessExpression>node;\n const expression = this.evaluateNode(elementAccessExpression.expression);\n if (isFoldableError(expression)) {\n return recordEntry(expression, node);\n }\n if (!elementAccessExpression.argumentExpression) {\n return recordEntry(errorSymbol('Expression form not supported', node), node);\n }\n const index = this.evaluateNode(elementAccessExpression.argumentExpression);\n if (isFoldableError(expression)) {\n return recordEntry(expression, node);\n }\n if (this.isFoldable(elementAccessExpression.expression) &&\n this.isFoldable(elementAccessExpression.argumentExpression))\n return (<any>expression)[<string|number>index];\n return recordEntry({__symbolic: 'index', expression, index}, node);\n }\n case ts.SyntaxKind.Identifier:\n const identifier = <ts.Identifier>node;\n const name = identifier.text;\n return resolveName(name, preferReference);\n case ts.SyntaxKind.TypeReference:\n const typeReferenceNode = <ts.TypeReferenceNode>node;\n const typeNameNode = typeReferenceNode.typeName;\n const getReference: (typeNameNode: ts.Identifier | ts.QualifiedName) => MetadataValue =\n node => {\n if (typeNameNode.kind === ts.SyntaxKind.QualifiedName) {\n const qualifiedName = <ts.QualifiedName>node;\n const left = this.evaluateNode(qualifiedName.left);\n if (isMetadataModuleReferenceExpression(left)) {\n return recordEntry(\n <MetadataImportedSymbolReferenceExpression>{\n __symbolic: 'reference',\n module: left.module,\n name: qualifiedName.right.text\n },\n node);\n }\n // Record a type reference to a declared type as a select.\n return {__symbolic: 'select', expression: left, member: qualifiedName.right.text};\n } else {\n const identifier = <ts.Identifier>typeNameNode;\n const symbol = this.symbols.resolve(identifier.text);\n if (isFoldableError(symbol) || isMetadataSymbolicReferenceExpression(symbol)) {\n return recordEntry(symbol, node);\n }\n return recordEntry(\n errorSymbol('Could not resolve type', node, {typeName: identifier.text}), node);\n }\n };\n const typeReference = getReference(typeNameNode);\n if (isFoldableError(typeReference)) {\n return recordEntry(typeReference, node);\n }\n if (!isMetadataModuleReferenceExpression(typeReference) &&\n typeReferenceNode.typeArguments && typeReferenceNode.typeArguments.length) {\n const args = typeReferenceNode.typeArguments.map(element => this.evaluateNode(element));\n // TODO: Remove typecast when upgraded to 2.0 as it will be corretly inferred.\n // Some versions of 1.9 do not infer this correctly.\n (<MetadataImportedSymbolReferenceExpression>typeReference).arguments = args;\n }\n return recordEntry(typeReference, node);\n case ts.SyntaxKind.UnionType:\n const unionType = <ts.UnionTypeNode>node;\n\n // Remove null and undefined from the list of unions.\n const references = unionType.types\n .filter(\n n => n.kind != ts.SyntaxKind.NullKeyword &&\n n.kind != ts.SyntaxKind.UndefinedKeyword)\n .map(n => this.evaluateNode(n));\n\n // The remmaining reference must be the same. If two have type arguments consider them\n // different even if the type arguments are the same.\n let candidate: any = null;\n for (let i = 0; i < references.length; i++) {\n const reference = references[i];\n if (isMetadataSymbolicReferenceExpression(reference)) {\n if (candidate) {\n if ((reference as any).name == candidate.name &&\n (reference as any).module == candidate.module && !(reference as any).arguments) {\n candidate = reference;\n }\n } else {\n candidate = reference;\n }\n } else {\n return reference;\n }\n }\n if (candidate) return candidate;\n break;\n case ts.SyntaxKind.NoSubstitutionTemplateLiteral:\n case ts.SyntaxKind.StringLiteral:\n case ts.SyntaxKind.TemplateHead:\n case ts.SyntaxKind.TemplateTail:\n case ts.SyntaxKind.TemplateMiddle:\n return (<ts.LiteralLikeNode>node).text;\n case ts.SyntaxKind.NumericLiteral:\n return parseFloat((<ts.LiteralExpression>node).text);\n case ts.SyntaxKind.AnyKeyword:\n return recordEntry({__symbolic: 'reference', name: 'any'}, node);\n case ts.SyntaxKind.StringKeyword:\n return recordEntry({__symbolic: 'reference', name: 'string'}, node);\n case ts.SyntaxKind.NumberKeyword:\n return recordEntry({__symbolic: 'reference', name: 'number'}, node);\n case ts.SyntaxKind.BooleanKeyword:\n return recordEntry({__symbolic: 'reference', name: 'boolean'}, node);\n case ts.SyntaxKind.ArrayType:\n const arrayTypeNode = <ts.ArrayTypeNode>node;\n return recordEntry(\n {\n __symbolic: 'reference',\n name: 'Array',\n arguments: [this.evaluateNode(arrayTypeNode.elementType)]\n },\n node);\n case ts.SyntaxKind.NullKeyword:\n return null;\n case ts.SyntaxKind.TrueKeyword:\n return true;\n case ts.SyntaxKind.FalseKeyword:\n return false;\n case ts.SyntaxKind.ParenthesizedExpression:\n const parenthesizedExpression = <ts.ParenthesizedExpression>node;\n return this.evaluateNode(parenthesizedExpression.expression);\n case ts.SyntaxKind.TypeAssertionExpression:\n const typeAssertion = <ts.TypeAssertion>node;\n return this.evaluateNode(typeAssertion.expression);\n case ts.SyntaxKind.PrefixUnaryExpression:\n const prefixUnaryExpression = <ts.PrefixUnaryExpression>node;\n const operand = this.evaluateNode(prefixUnaryExpression.operand);\n if (isDefined(operand) && isPrimitive(operand)) {\n switch (prefixUnaryExpression.operator) {\n case ts.SyntaxKind.PlusToken:\n return +(operand as any);\n case ts.SyntaxKind.MinusToken:\n return -(operand as any);\n case ts.SyntaxKind.TildeToken:\n return ~(operand as any);\n case ts.SyntaxKind.ExclamationToken:\n return !operand;\n }\n }\n let operatorText: string;\n switch (prefixUnaryExpression.operator) {\n case ts.SyntaxKind.PlusToken:\n operatorText = '+';\n break;\n case ts.SyntaxKind.MinusToken:\n operatorText = '-';\n break;\n case ts.SyntaxKind.TildeToken:\n operatorText = '~';\n break;\n case ts.SyntaxKind.ExclamationToken:\n operatorText = '!';\n break;\n default:\n return undefined;\n }\n return recordEntry({__symbolic: 'pre', operator: operatorText, operand: operand}, node);\n case ts.SyntaxKind.BinaryExpression:\n const binaryExpression = <ts.BinaryExpression>node;\n const left = this.evaluateNode(binaryExpression.left);\n const right = this.evaluateNode(binaryExpression.right);\n if (isDefined(left) && isDefined(right)) {\n if (isPrimitive(left) && isPrimitive(right))\n switch (binaryExpression.operatorToken.kind) {\n case ts.SyntaxKind.BarBarToken:\n return <any>left || <any>right;\n case ts.SyntaxKind.AmpersandAmpersandToken:\n return <any>left && <any>right;\n case ts.SyntaxKind.AmpersandToken:\n return <any>left & <any>right;\n case ts.SyntaxKind.BarToken:\n return <any>left | <any>right;\n case ts.SyntaxKind.CaretToken:\n return <any>left ^ <any>right;\n case ts.SyntaxKind.EqualsEqualsToken:\n return <any>left == <any>right;\n case ts.SyntaxKind.ExclamationEqualsToken:\n return <any>left != <any>right;\n case ts.SyntaxKind.EqualsEqualsEqualsToken:\n return <any>left === <any>right;\n case ts.SyntaxKind.ExclamationEqualsEqualsToken:\n return <any>left !== <any>right;\n case ts.SyntaxKind.LessThanToken:\n return <any>left < <any>right;\n case ts.SyntaxKind.GreaterThanToken:\n return <any>left > <any>right;\n case ts.SyntaxKind.LessThanEqualsToken:\n return <any>left <= <any>right;\n case ts.SyntaxKind.GreaterThanEqualsToken:\n return <any>left >= <any>right;\n case ts.SyntaxKind.LessThanLessThanToken:\n return (<any>left) << (<any>right);\n case ts.SyntaxKind.GreaterThanGreaterThanToken:\n return <any>left >> <any>right;\n case ts.SyntaxKind.GreaterThanGreaterThanGreaterThanToken:\n return <any>left >>> <any>right;\n case ts.SyntaxKind.PlusToken:\n return <any>left + <any>right;\n case ts.SyntaxKind.MinusToken:\n return <any>left - <any>right;\n case ts.SyntaxKind.AsteriskToken:\n return <any>left * <any>right;\n case ts.SyntaxKind.SlashToken:\n return <any>left / <any>right;\n case ts.SyntaxKind.PercentToken:\n return <any>left % <any>right;\n }\n return recordEntry(\n {\n __symbolic: 'binop',\n operator: binaryExpression.operatorToken.getText(),\n left: left,\n right: right\n },\n node);\n }\n break;\n case ts.SyntaxKind.ConditionalExpression:\n const conditionalExpression = <ts.ConditionalExpression>node;\n const condition = this.evaluateNode(conditionalExpression.condition);\n const thenExpression = this.evaluateNode(conditionalExpression.whenTrue);\n const elseExpression = this.evaluateNode(conditionalExpression.whenFalse);\n if (isPrimitive(condition)) {\n return condition ? thenExpression : elseExpression;\n }\n return recordEntry({__symbolic: 'if', condition, thenExpression, elseExpression}, node);\n case ts.SyntaxKind.FunctionExpression:\n case ts.SyntaxKind.ArrowFunction:\n return recordEntry(errorSymbol('Lambda not supported', node), node);\n case ts.SyntaxKind.TaggedTemplateExpression:\n return recordEntry(\n errorSymbol('Tagged template expressions are not supported in metadata', node), node);\n case ts.SyntaxKind.TemplateExpression:\n const templateExpression = <ts.TemplateExpression>node;\n if (this.isFoldable(node)) {\n return templateExpression.templateSpans.reduce(\n (previous, current) => previous + <string>this.evaluateNode(current.expression) +\n <string>this.evaluateNode(current.literal),\n this.evaluateNode(templateExpression.head));\n } else {\n return templateExpression.templateSpans.reduce((previous, current) => {\n const expr = this.evaluateNode(current.expression);\n const literal = this.evaluateNode(current.literal);\n if (isFoldableError(expr)) return expr;\n if (isFoldableError(literal)) return literal;\n if (typeof previous === 'string' && typeof expr === 'string' &&\n typeof literal === 'string') {\n return previous + expr + literal;\n }\n let result = expr;\n if (previous !== '') {\n result = {__symbolic: 'binop', operator: '+', left: previous, right: expr};\n }\n if (literal != '') {\n result = {__symbolic: 'binop', operator: '+', left: result, right: literal};\n }\n return result;\n }, this.evaluateNode(templateExpression.head));\n }\n case ts.SyntaxKind.AsExpression:\n const asExpression = <ts.AsExpression>node;\n return this.evaluateNode(asExpression.expression);\n case ts.SyntaxKind.ClassExpression:\n return {__symbolic: 'class'};\n }\n return recordEntry(errorSymbol('Expression form not supported', node), node);\n }\n}\n\nfunction isPropertyAssignment(node: ts.Node): node is ts.PropertyAssignment {\n return node.kind == ts.SyntaxKind.PropertyAssignment;\n}\n\nconst empty = ts.createNodeArray<any>();\n\nfunction arrayOrEmpty<T extends ts.Node>(v: ts.NodeArray<T>| undefined): ts.NodeArray<T> {\n return v || empty;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/transformers/api.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAKU,QAAA,kBAAkB,GAAG,GAAG,CAAC;AACzB,QAAA,kBAAkB,GAAG,GAAG,CAAC;AACzB,QAAA,MAAM,GAAG,SAAsB,CAAC;AAkB7C,wBAA+B,UAAe;IAC5C,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,CAAC;AAC/D,CAAC;AAFD,wCAEC;AAED,wBAA+B,UAAe;IAC5C,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,CAAC;AAC/D,CAAC;AAFD,wCAEC;AA8KD,IAAY,SASX;AATD,WAAY,SAAS;IACnB,uCAAY,CAAA;IACZ,qCAAW,CAAA;IACX,iDAAiB,CAAA;IACjB,qDAAmB,CAAA;IACnB,gDAAgB,CAAA;IAEhB,gDAA4B,CAAA;IAC5B,wCAAgD,CAAA;AAClD,CAAC,EATW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QASpB","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {GeneratedFile, ParseSourceSpan, Position} from '@angular/compiler';\nimport * as ts from 'typescript';\n\nexport const DEFAULT_ERROR_CODE = 100;\nexport const UNKNOWN_ERROR_CODE = 500;\nexport const SOURCE = 'angular' as 'angular';\n\nexport interface DiagnosticMessageChain {\n messageText: string;\n position?: Position;\n next?: DiagnosticMessageChain;\n}\n\nexport interface Diagnostic {\n messageText: string;\n span?: ParseSourceSpan;\n position?: Position;\n chain?: DiagnosticMessageChain;\n category: ts.DiagnosticCategory;\n code: number;\n source: 'angular';\n}\n\nexport function isTsDiagnostic(diagnostic: any): diagnostic is ts.Diagnostic {\n return diagnostic != null && diagnostic.source !== 'angular';\n}\n\nexport function isNgDiagnostic(diagnostic: any): diagnostic is Diagnostic {\n return diagnostic != null && diagnostic.source === 'angular';\n}\n\nexport interface CompilerOptions extends ts.CompilerOptions {\n // Write statistics about compilation (e.g. total time, ...)\n // Note: this is the --diagnostics command line option from TS (which is @internal\n // on ts.CompilerOptions interface).\n diagnostics?: boolean;\n\n // Absolute path to a directory where generated file structure is written.\n // If unspecified, generated files will be written alongside sources.\n // @deprecated - no effect\n genDir?: string;\n\n // Path to the directory containing the tsconfig.json file.\n basePath?: string;\n\n // Don't produce .metadata.json files (they don't work for bundled emit with --out)\n skipMetadataEmit?: boolean;\n\n // Produce an error if the metadata written for a class would produce an error if used.\n strictMetadataEmit?: boolean;\n\n // Don't produce .ngfactory.ts or .ngstyle.ts files\n skipTemplateCodegen?: boolean;\n\n // Always report errors when the type of a parameter supplied whose injection type cannot\n // be determined. When this value option is not provided or is `false`, constructor\n // parameters of classes marked with `@Injectable` whose type cannot be resolved will\n // produce a warning. With this option `true`, they produce an error. When this option is\n // not provided is treated as if it were `false`. In Angular 6.0, if this option is not\n // provided, it will be treated as `true`.\n strictInjectionParameters?: boolean;\n\n // Whether to generate a flat module index of the given name and the corresponding\n // flat module metadata. This option is intended to be used when creating flat\n // modules similar to how `@angular/core` and `@angular/common` are packaged.\n // When this option is used the `package.json` for the library should refered to the\n // generated flat module index instead of the library index file. When using this\n // option only one .metadata.json file is produced that contains all the metadata\n // necessary for symbols exported from the library index.\n // In the generated .ngfactory.ts files flat module index is used to import symbols\n // includes both the public API from the library index as well as shrowded internal\n // symbols.\n // By default the .ts file supplied in the `files` files field is assumed to be\n // library index. If more than one is specified, uses `libraryIndex` to select the\n // file to use. If more than on .ts file is supplied and no `libraryIndex` is supplied\n // an error is produced.\n // A flat module index .d.ts and .js will be created with the given `flatModuleOutFile`\n // name in the same location as the library index .d.ts file is emitted.\n // For example, if a library uses `public_api.ts` file as the library index of the\n // module the `tsconfig.json` `files` field would be `[\"public_api.ts\"]`. The\n // `flatModuleOutFile` options could then be set to, for example `\"index.js\"`, which\n // produces `index.d.ts` and `index.metadata.json` files. The library's\n // `package.json`'s `module` field would be `\"index.js\"` and the `typings` field would\n // be `\"index.d.ts\"`.\n flatModuleOutFile?: string;\n\n // Preferred module id to use for importing flat module. References generated by `ngc`\n // will use this module name when importing symbols from the flat module. This is only\n // meaningful when `flatModuleOutFile` is also supplied. It is otherwise ignored.\n flatModuleId?: string;\n\n // Whether to generate code for library code.\n // If true, produce .ngfactory.ts and .ngstyle.ts files for .d.ts inputs.\n // Default is true.\n generateCodeForLibraries?: boolean;\n\n // Whether to enable all type checks for templates.\n // This will be true be default in Angular 6.\n fullTemplateTypeCheck?: boolean;\n\n // Insert JSDoc type annotations needed by Closure Compiler\n annotateForClosureCompiler?: boolean;\n\n // Modify how angular annotations are emitted to improve tree-shaking.\n // Default is static fields.\n // decorators: Leave the Decorators in-place. This makes compilation faster.\n // TypeScript will emit calls to the __decorate helper.\n // `--emitDecoratorMetadata` can be used for runtime reflection.\n // However, the resulting code will not properly tree-shake.\n // static fields: Replace decorators with a static field in the class.\n // Allows advanced tree-shakers like Closure Compiler to remove\n // unused classes.\n annotationsAs?: 'decorators'|'static fields';\n\n // Print extra information while running the compiler\n trace?: boolean;\n\n // Whether to enable support for <template> and the template attribute (false by default)\n enableLegacyTemplate?: boolean;\n\n // Whether to enable lowering expressions lambdas and expressions in a reference value\n // position.\n disableExpressionLowering?: boolean;\n\n // Locale of the application\n i18nOutLocale?: string;\n // Export format (xlf, xlf2 or xmb)\n i18nOutFormat?: string;\n // Path to the extracted message file\n i18nOutFile?: string;\n\n // Import format if different from `i18nFormat`\n i18nInFormat?: string;\n // Locale of the imported translations\n i18nInLocale?: string;\n // Path to the translation file\n i18nInFile?: string;\n // How to handle missing messages\n i18nInMissingTranslations?: 'error'|'warning'|'ignore';\n\n // Whether to remove blank text nodes from compiled templates. It is `true` by default\n // in Angular 5 and will be re-visited in Angular 6.\n preserveWhitespaces?: boolean;\n\n /** generate all possible generated files */\n allowEmptyCodegenFiles?: boolean;\n\n /**\n * Whether to generate .ngsummary.ts files that allow to use AOTed artifacts\n * in JIT mode. This is off by default.\n */\n enableSummariesForJit?: boolean;\n\n /** @internal */\n collectAllErrors?: boolean;\n}\n\nexport interface CompilerHost extends ts.CompilerHost {\n /**\n * Converts a module name that is used in an `import` to a file path.\n * I.e. `path/to/containingFile.ts` containing `import {...} from 'module-name'`.\n */\n moduleNameToFileName?(moduleName: string, containingFile: string): string|null;\n /**\n * Converts a file path to a module name that can be used as an `import ...`\n * I.e. `path/to/importedFile.ts` should be imported by `path/to/containingFile.ts`.\n */\n fileNameToModuleName?(importedFilePath: string, containingFilePath: string): string;\n /**\n * Converts a file path for a resource that is used in a source file or another resource\n * into a filepath.\n */\n resourceNameToFileName?(resourceName: string, containingFilePath: string): string|null;\n /**\n * Converts a file name into a representation that should be stored in a summary file.\n * This has to include changing the suffix as well.\n * E.g.\n * `some_file.ts` -> `some_file.d.ts`\n *\n * @param referringSrcFileName the soure file that refers to fileName\n */\n toSummaryFileName?(fileName: string, referringSrcFileName: string): string;\n /**\n * Converts a fileName that was processed by `toSummaryFileName` back into a real fileName\n * given the fileName of the library that is referrig to it.\n */\n fromSummaryFileName?(fileName: string, referringLibFileName: string): string;\n /**\n * Load a referenced resource either statically or asynchronously. If the host returns a\n * `Promise<string>` it is assumed the user of the corresponding `Program` will call\n * `loadNgStructureAsync()`. Returing `Promise<string>` outside `loadNgStructureAsync()` will\n * cause a diagnostics diagnostic error or an exception to be thrown.\n */\n readResource?(fileName: string): Promise<string>|string;\n /**\n * Produce an AMD module name for the source file. Used in Bazel.\n *\n * An AMD module can have an arbitrary name, so that it is require'd by name\n * rather than by path. See http://requirejs.org/docs/whyamd.html#namedmodules\n */\n amdModuleName?(sf: ts.SourceFile): string|undefined;\n}\n\nexport enum EmitFlags {\n DTS = 1 << 0,\n JS = 1 << 1,\n Metadata = 1 << 2,\n I18nBundle = 1 << 3,\n Codegen = 1 << 4,\n\n Default = DTS | JS | Codegen,\n All = DTS | JS | Metadata | I18nBundle | Codegen,\n}\n\nexport interface CustomTransformers {\n beforeTs?: ts.TransformerFactory<ts.SourceFile>[];\n afterTs?: ts.TransformerFactory<ts.SourceFile>[];\n}\n\nexport interface TsEmitArguments {\n program: ts.Program;\n host: CompilerHost;\n options: CompilerOptions;\n targetSourceFile?: ts.SourceFile;\n writeFile?: ts.WriteFileCallback;\n cancellationToken?: ts.CancellationToken;\n emitOnlyDtsFiles?: boolean;\n customTransformers?: ts.CustomTransformers;\n}\n\nexport interface TsEmitCallback { (args: TsEmitArguments): ts.EmitResult; }\n\n/**\n * @internal\n */\nexport interface LibrarySummary {\n fileName: string;\n text: string;\n sourceFile?: ts.SourceFile;\n}\n\nexport interface LazyRoute {\n route: string;\n module: {name: string, filePath: string};\n referencedModule: {name: string, filePath: string};\n}\n\nexport interface Program {\n /**\n * Retrieve the TypeScript program used to produce semantic diagnostics and emit the sources.\n *\n * Angular structural information is required to produce the program.\n */\n getTsProgram(): ts.Program;\n\n /**\n * Retrieve options diagnostics for the TypeScript options used to create the program. This is\n * faster than calling `getTsProgram().getOptionsDiagnostics()` since it does not need to\n * collect Angular structural information to produce the errors.\n */\n getTsOptionDiagnostics(cancellationToken?: ts.CancellationToken): ReadonlyArray<ts.Diagnostic>;\n\n /**\n * Retrieve options diagnostics for the Angular options used to create the program.\n */\n getNgOptionDiagnostics(cancellationToken?: ts.CancellationToken): ReadonlyArray<Diagnostic>;\n\n /**\n * Retrieve the syntax diagnostics from TypeScript. This is faster than calling\n * `getTsProgram().getSyntacticDiagnostics()` since it does not need to collect Angular structural\n * information to produce the errors.\n */\n getTsSyntacticDiagnostics(sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken):\n ReadonlyArray<ts.Diagnostic>;\n\n /**\n * Retrieve the diagnostics for the structure of an Angular application is correctly formed.\n * This includes validating Angular annotations and the syntax of referenced and imbedded HTML\n * and CSS.\n *\n * Note it is important to displaying TypeScript semantic diagnostics along with Angular\n * structural diagnostics as an error in the program strucutre might cause errors detected in\n * semantic analysis and a semantic error might cause errors in specifying the program structure.\n *\n * Angular structural information is required to produce these diagnostics.\n */\n getNgStructuralDiagnostics(cancellationToken?: ts.CancellationToken): ReadonlyArray<Diagnostic>;\n\n /**\n * Retrieve the semantic diagnostics from TypeScript. This is equivilent to calling\n * `getTsProgram().getSemanticDiagnostics()` directly and is included for completeness.\n */\n getTsSemanticDiagnostics(sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken):\n ReadonlyArray<ts.Diagnostic>;\n\n /**\n * Retrieve the Angular semantic diagnostics.\n *\n * Angular structural information is required to produce these diagnostics.\n */\n getNgSemanticDiagnostics(fileName?: string, cancellationToken?: ts.CancellationToken):\n ReadonlyArray<Diagnostic>;\n\n /**\n * Load Angular structural information asynchronously. If this method is not called then the\n * Angular structural information, including referenced HTML and CSS files, are loaded\n * synchronously. If the supplied Angular compiler host returns a promise from `loadResource()`\n * will produce a diagnostic error message or, `getTsProgram()` or `emit` to throw.\n */\n loadNgStructureAsync(): Promise<void>;\n\n /**\n * Returns the lazy routes in the program.\n * @param entryRoute A reference to an NgModule like `someModule#name`. If given,\n * will recursively analyze routes starting from this symbol only.\n * Otherwise will list all routes for all NgModules in the program/\n */\n listLazyRoutes(entryRoute?: string): LazyRoute[];\n\n /**\n * Emit the files requested by emitFlags implied by the program.\n *\n * Angular structural information is required to emit files.\n */\n emit({emitFlags, cancellationToken, customTransformers, emitCallback}?: {\n emitFlags?: EmitFlags,\n cancellationToken?: ts.CancellationToken,\n customTransformers?: CustomTransformers,\n emitCallback?: TsEmitCallback\n }): ts.EmitResult;\n\n /**\n * Returns the .d.ts / .ngsummary.json / .ngfactory.d.ts files of libraries that have been emitted\n * in this program or previous programs with paths that emulate the fact that these libraries\n * have been compiled before with no outDir.\n *\n * @internal\n */\n getLibrarySummaries(): Map<string, LibrarySummary>;\n\n /**\n * @internal\n */\n getEmittedGeneratedFiles(): Map<string, GeneratedFile>;\n\n /**\n * @internal\n */\n getEmittedSourceFiles(): Map<string, ts.SourceFile>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/transformers/api.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAKU,QAAA,kBAAkB,GAAG,GAAG,CAAC;AACzB,QAAA,kBAAkB,GAAG,GAAG,CAAC;AACzB,QAAA,MAAM,GAAG,SAAsB,CAAC;AAkB7C,wBAA+B,UAAe;IAC5C,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,CAAC;AAC/D,CAAC;AAFD,wCAEC;AAED,wBAA+B,UAAe;IAC5C,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,CAAC;AAC/D,CAAC;AAFD,wCAEC;AA8KD,IAAY,SASX;AATD,WAAY,SAAS;IACnB,uCAAY,CAAA;IACZ,qCAAW,CAAA;IACX,iDAAiB,CAAA;IACjB,qDAAmB,CAAA;IACnB,gDAAgB,CAAA;IAEhB,gDAA4B,CAAA;IAC5B,wCAAgD,CAAA;AAClD,CAAC,EATW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QASpB","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {GeneratedFile, ParseSourceSpan, Position} from '@angular/compiler';\nimport * as ts from 'typescript';\n\nexport const DEFAULT_ERROR_CODE = 100;\nexport const UNKNOWN_ERROR_CODE = 500;\nexport const SOURCE = 'angular' as 'angular';\n\nexport interface DiagnosticMessageChain {\n messageText: string;\n position?: Position;\n next?: DiagnosticMessageChain;\n}\n\nexport interface Diagnostic {\n messageText: string;\n span?: ParseSourceSpan;\n position?: Position;\n chain?: DiagnosticMessageChain;\n category: ts.DiagnosticCategory;\n code: number;\n source: 'angular';\n}\n\nexport function isTsDiagnostic(diagnostic: any): diagnostic is ts.Diagnostic {\n return diagnostic != null && diagnostic.source !== 'angular';\n}\n\nexport function isNgDiagnostic(diagnostic: any): diagnostic is Diagnostic {\n return diagnostic != null && diagnostic.source === 'angular';\n}\n\nexport interface CompilerOptions extends ts.CompilerOptions {\n // Write statistics about compilation (e.g. total time, ...)\n // Note: this is the --diagnostics command line option from TS (which is @internal\n // on ts.CompilerOptions interface).\n diagnostics?: boolean;\n\n // Absolute path to a directory where generated file structure is written.\n // If unspecified, generated files will be written alongside sources.\n // @deprecated - no effect\n genDir?: string;\n\n // Path to the directory containing the tsconfig.json file.\n basePath?: string;\n\n // Don't produce .metadata.json files (they don't work for bundled emit with --out)\n skipMetadataEmit?: boolean;\n\n // Produce an error if the metadata written for a class would produce an error if used.\n strictMetadataEmit?: boolean;\n\n // Don't produce .ngfactory.js or .ngstyle.js files\n skipTemplateCodegen?: boolean;\n\n // Always report errors when the type of a parameter supplied whose injection type cannot\n // be determined. When this value option is not provided or is `false`, constructor\n // parameters of classes marked with `@Injectable` whose type cannot be resolved will\n // produce a warning. With this option `true`, they produce an error. When this option is\n // not provided is treated as if it were `false`. In Angular 6.0, if this option is not\n // provided, it will be treated as `true`.\n strictInjectionParameters?: boolean;\n\n // Whether to generate a flat module index of the given name and the corresponding\n // flat module metadata. This option is intended to be used when creating flat\n // modules similar to how `@angular/core` and `@angular/common` are packaged.\n // When this option is used the `package.json` for the library should refered to the\n // generated flat module index instead of the library index file. When using this\n // option only one .metadata.json file is produced that contains all the metadata\n // necessary for symbols exported from the library index.\n // In the generated .ngfactory.ts files flat module index is used to import symbols\n // includes both the public API from the library index as well as shrowded internal\n // symbols.\n // By default the .ts file supplied in the `files` files field is assumed to be\n // library index. If more than one is specified, uses `libraryIndex` to select the\n // file to use. If more than on .ts file is supplied and no `libraryIndex` is supplied\n // an error is produced.\n // A flat module index .d.ts and .js will be created with the given `flatModuleOutFile`\n // name in the same location as the library index .d.ts file is emitted.\n // For example, if a library uses `public_api.ts` file as the library index of the\n // module the `tsconfig.json` `files` field would be `[\"public_api.ts\"]`. The\n // `flatModuleOutFile` options could then be set to, for example `\"index.js\"`, which\n // produces `index.d.ts` and `index.metadata.json` files. The library's\n // `package.json`'s `module` field would be `\"index.js\"` and the `typings` field would\n // be `\"index.d.ts\"`.\n flatModuleOutFile?: string;\n\n // Preferred module id to use for importing flat module. References generated by `ngc`\n // will use this module name when importing symbols from the flat module. This is only\n // meaningful when `flatModuleOutFile` is also supplied. It is otherwise ignored.\n flatModuleId?: string;\n\n // Whether to generate code for library code.\n // If true, produce .ngfactory.ts and .ngstyle.ts files for .d.ts inputs.\n // Default is true.\n generateCodeForLibraries?: boolean;\n\n // Whether to enable all type checks for templates.\n // This will be true be default in Angular 6.\n fullTemplateTypeCheck?: boolean;\n\n // Insert JSDoc type annotations needed by Closure Compiler\n annotateForClosureCompiler?: boolean;\n\n // Modify how angular annotations are emitted to improve tree-shaking.\n // Default is static fields.\n // decorators: Leave the Decorators in-place. This makes compilation faster.\n // TypeScript will emit calls to the __decorate helper.\n // `--emitDecoratorMetadata` can be used for runtime reflection.\n // However, the resulting code will not properly tree-shake.\n // static fields: Replace decorators with a static field in the class.\n // Allows advanced tree-shakers like Closure Compiler to remove\n // unused classes.\n annotationsAs?: 'decorators'|'static fields';\n\n // Print extra information while running the compiler\n trace?: boolean;\n\n // Whether to enable support for <template> and the template attribute (false by default)\n enableLegacyTemplate?: boolean;\n\n // Whether to enable lowering expressions lambdas and expressions in a reference value\n // position.\n disableExpressionLowering?: boolean;\n\n // Locale of the application\n i18nOutLocale?: string;\n // Export format (xlf, xlf2 or xmb)\n i18nOutFormat?: string;\n // Path to the extracted message file\n i18nOutFile?: string;\n\n // Import format if different from `i18nFormat`\n i18nInFormat?: string;\n // Locale of the imported translations\n i18nInLocale?: string;\n // Path to the translation file\n i18nInFile?: string;\n // How to handle missing messages\n i18nInMissingTranslations?: 'error'|'warning'|'ignore';\n\n // Whether to remove blank text nodes from compiled templates. It is `true` by default\n // in Angular 5 and will be re-visited in Angular 6.\n preserveWhitespaces?: boolean;\n\n /** generate all possible generated files */\n allowEmptyCodegenFiles?: boolean;\n\n /**\n * Whether to generate .ngsummary.ts files that allow to use AOTed artifacts\n * in JIT mode. This is off by default.\n */\n enableSummariesForJit?: boolean;\n\n /** @internal */\n collectAllErrors?: boolean;\n}\n\nexport interface CompilerHost extends ts.CompilerHost {\n /**\n * Converts a module name that is used in an `import` to a file path.\n * I.e. `path/to/containingFile.ts` containing `import {...} from 'module-name'`.\n */\n moduleNameToFileName?(moduleName: string, containingFile: string): string|null;\n /**\n * Converts a file path to a module name that can be used as an `import ...`\n * I.e. `path/to/importedFile.ts` should be imported by `path/to/containingFile.ts`.\n */\n fileNameToModuleName?(importedFilePath: string, containingFilePath: string): string;\n /**\n * Converts a file path for a resource that is used in a source file or another resource\n * into a filepath.\n */\n resourceNameToFileName?(resourceName: string, containingFilePath: string): string|null;\n /**\n * Converts a file name into a representation that should be stored in a summary file.\n * This has to include changing the suffix as well.\n * E.g.\n * `some_file.ts` -> `some_file.d.ts`\n *\n * @param referringSrcFileName the soure file that refers to fileName\n */\n toSummaryFileName?(fileName: string, referringSrcFileName: string): string;\n /**\n * Converts a fileName that was processed by `toSummaryFileName` back into a real fileName\n * given the fileName of the library that is referrig to it.\n */\n fromSummaryFileName?(fileName: string, referringLibFileName: string): string;\n /**\n * Load a referenced resource either statically or asynchronously. If the host returns a\n * `Promise<string>` it is assumed the user of the corresponding `Program` will call\n * `loadNgStructureAsync()`. Returing `Promise<string>` outside `loadNgStructureAsync()` will\n * cause a diagnostics diagnostic error or an exception to be thrown.\n */\n readResource?(fileName: string): Promise<string>|string;\n /**\n * Produce an AMD module name for the source file. Used in Bazel.\n *\n * An AMD module can have an arbitrary name, so that it is require'd by name\n * rather than by path. See http://requirejs.org/docs/whyamd.html#namedmodules\n */\n amdModuleName?(sf: ts.SourceFile): string|undefined;\n}\n\nexport enum EmitFlags {\n DTS = 1 << 0,\n JS = 1 << 1,\n Metadata = 1 << 2,\n I18nBundle = 1 << 3,\n Codegen = 1 << 4,\n\n Default = DTS | JS | Codegen,\n All = DTS | JS | Metadata | I18nBundle | Codegen,\n}\n\nexport interface CustomTransformers {\n beforeTs?: ts.TransformerFactory<ts.SourceFile>[];\n afterTs?: ts.TransformerFactory<ts.SourceFile>[];\n}\n\nexport interface TsEmitArguments {\n program: ts.Program;\n host: CompilerHost;\n options: CompilerOptions;\n targetSourceFile?: ts.SourceFile;\n writeFile?: ts.WriteFileCallback;\n cancellationToken?: ts.CancellationToken;\n emitOnlyDtsFiles?: boolean;\n customTransformers?: ts.CustomTransformers;\n}\n\nexport interface TsEmitCallback { (args: TsEmitArguments): ts.EmitResult; }\n\n/**\n * @internal\n */\nexport interface LibrarySummary {\n fileName: string;\n text: string;\n sourceFile?: ts.SourceFile;\n}\n\nexport interface LazyRoute {\n route: string;\n module: {name: string, filePath: string};\n referencedModule: {name: string, filePath: string};\n}\n\nexport interface Program {\n /**\n * Retrieve the TypeScript program used to produce semantic diagnostics and emit the sources.\n *\n * Angular structural information is required to produce the program.\n */\n getTsProgram(): ts.Program;\n\n /**\n * Retrieve options diagnostics for the TypeScript options used to create the program. This is\n * faster than calling `getTsProgram().getOptionsDiagnostics()` since it does not need to\n * collect Angular structural information to produce the errors.\n */\n getTsOptionDiagnostics(cancellationToken?: ts.CancellationToken): ReadonlyArray<ts.Diagnostic>;\n\n /**\n * Retrieve options diagnostics for the Angular options used to create the program.\n */\n getNgOptionDiagnostics(cancellationToken?: ts.CancellationToken): ReadonlyArray<Diagnostic>;\n\n /**\n * Retrieve the syntax diagnostics from TypeScript. This is faster than calling\n * `getTsProgram().getSyntacticDiagnostics()` since it does not need to collect Angular structural\n * information to produce the errors.\n */\n getTsSyntacticDiagnostics(sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken):\n ReadonlyArray<ts.Diagnostic>;\n\n /**\n * Retrieve the diagnostics for the structure of an Angular application is correctly formed.\n * This includes validating Angular annotations and the syntax of referenced and imbedded HTML\n * and CSS.\n *\n * Note it is important to displaying TypeScript semantic diagnostics along with Angular\n * structural diagnostics as an error in the program strucutre might cause errors detected in\n * semantic analysis and a semantic error might cause errors in specifying the program structure.\n *\n * Angular structural information is required to produce these diagnostics.\n */\n getNgStructuralDiagnostics(cancellationToken?: ts.CancellationToken): ReadonlyArray<Diagnostic>;\n\n /**\n * Retrieve the semantic diagnostics from TypeScript. This is equivilent to calling\n * `getTsProgram().getSemanticDiagnostics()` directly and is included for completeness.\n */\n getTsSemanticDiagnostics(sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken):\n ReadonlyArray<ts.Diagnostic>;\n\n /**\n * Retrieve the Angular semantic diagnostics.\n *\n * Angular structural information is required to produce these diagnostics.\n */\n getNgSemanticDiagnostics(fileName?: string, cancellationToken?: ts.CancellationToken):\n ReadonlyArray<Diagnostic>;\n\n /**\n * Load Angular structural information asynchronously. If this method is not called then the\n * Angular structural information, including referenced HTML and CSS files, are loaded\n * synchronously. If the supplied Angular compiler host returns a promise from `loadResource()`\n * will produce a diagnostic error message or, `getTsProgram()` or `emit` to throw.\n */\n loadNgStructureAsync(): Promise<void>;\n\n /**\n * Returns the lazy routes in the program.\n * @param entryRoute A reference to an NgModule like `someModule#name`. If given,\n * will recursively analyze routes starting from this symbol only.\n * Otherwise will list all routes for all NgModules in the program/\n */\n listLazyRoutes(entryRoute?: string): LazyRoute[];\n\n /**\n * Emit the files requested by emitFlags implied by the program.\n *\n * Angular structural information is required to emit files.\n */\n emit({emitFlags, cancellationToken, customTransformers, emitCallback}?: {\n emitFlags?: EmitFlags,\n cancellationToken?: ts.CancellationToken,\n customTransformers?: CustomTransformers,\n emitCallback?: TsEmitCallback\n }): ts.EmitResult;\n\n /**\n * Returns the .d.ts / .ngsummary.json / .ngfactory.d.ts files of libraries that have been emitted\n * in this program or previous programs with paths that emulate the fact that these libraries\n * have been compiled before with no outDir.\n *\n * @internal\n */\n getLibrarySummaries(): Map<string, LibrarySummary>;\n\n /**\n * @internal\n */\n getEmittedGeneratedFiles(): Map<string, GeneratedFile>;\n\n /**\n * @internal\n */\n getEmittedSourceFiles(): Map<string, ts.SourceFile>;\n}\n"]}
|
|
@@ -94,6 +94,7 @@ export declare class TsCompilerAotCompilerTypeCheckHostAdapter implements ts.Com
|
|
|
94
94
|
readFile(fileName: string): string | undefined;
|
|
95
95
|
getMetadataFor(filePath: string): ModuleMetadata[] | undefined;
|
|
96
96
|
loadResource(filePath: string): Promise<string> | string;
|
|
97
|
+
getOutputName(filePath: string): string;
|
|
97
98
|
private hasBundleIndex(filePath);
|
|
98
99
|
getDefaultLibFileName: (options: ts.CompilerOptions) => string;
|
|
99
100
|
getCurrentDirectory: () => string;
|
|
@@ -432,6 +432,9 @@ var TsCompilerAotCompilerTypeCheckHostAdapter = /** @class */ (function () {
|
|
|
432
432
|
}
|
|
433
433
|
return assert(this.context.readFile(filePath));
|
|
434
434
|
};
|
|
435
|
+
TsCompilerAotCompilerTypeCheckHostAdapter.prototype.getOutputName = function (filePath) {
|
|
436
|
+
return path.relative(this.getCurrentDirectory(), filePath);
|
|
437
|
+
};
|
|
435
438
|
TsCompilerAotCompilerTypeCheckHostAdapter.prototype.hasBundleIndex = function (filePath) {
|
|
436
439
|
var _this = this;
|
|
437
440
|
var checkBundleIndex = function (directory) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler_host.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/transformers/compiler_host.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,8CAAuL;AACvL,2BAA6B;AAC7B,+BAAiC;AAMjC,qDAA8F;AAC9F,+BAA6E;AAE7E,IAAM,yBAAyB,GAAG,6CAA6C,CAAC;AAChF,IAAM,GAAG,GAAG,kCAAkC,CAAC;AAE/C,4BACI,EACwD;QADvD,oBAAO,EAAE,cAA6C,EAA7C,kEAA6C;IAEzD,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC;AAJD,gDAIC;AAiBD,g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CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAClE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,wBAAwB,QAAgB;IACtC,IAAM,KAAK,GAAG,yBAAyB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,gCAAgC,QAAgB;IAC9C,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,8BAA8B,QAAgB;IAC5C,IAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,+BAA+B,QAAgB;IAC7C,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,6BAA6B,QAAgB;IAC3C,MAAM,CAAI,QAAQ,kBAAe,CAAC;AACpC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AotCompilerHost, EmitterVisitorContext, ExternalReference, GeneratedFile, ParseSourceSpan, TypeScriptEmitter, collectExternalReferences, syntaxError} from '@angular/compiler';\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nimport {TypeCheckHost} from '../diagnostics/translate_diagnostics';\nimport {METADATA_VERSION, ModuleMetadata} from '../metadata/index';\n\nimport {CompilerHost, CompilerOptions, LibrarySummary} from './api';\nimport {MetadataReaderHost, createMetadataReaderCache, readMetadata} from './metadata_reader';\nimport {DTS, GENERATED_FILES, isInRootDir, relativeToRootDirs} from './util';\n\nconst NODE_MODULES_PACKAGE_NAME = /node_modules\\/((\\w|-)+|(@(\\w|-)+\\/(\\w|-)+))/;\nconst EXT = /(\\.ts|\\.d\\.ts|\\.js|\\.jsx|\\.tsx)$/;\n\nexport function createCompilerHost(\n {options, tsHost = ts.createCompilerHost(options, true)}:\n {options: CompilerOptions, tsHost?: ts.CompilerHost}): CompilerHost {\n return tsHost;\n}\n\nexport interface MetadataProvider {\n getMetadata(sourceFile: ts.SourceFile): ModuleMetadata|undefined;\n}\n\ninterface GenSourceFile {\n externalReferences: Set<string>;\n sourceFile: ts.SourceFile;\n emitCtx: EmitterVisitorContext;\n}\n\nexport interface CodeGenerator {\n generateFile(genFileName: string, baseFileName?: string): GeneratedFile;\n findGeneratedFileNames(fileName: string): string[];\n}\n\nfunction assert<T>(condition: T | null | undefined) {\n if (!condition) {\n // TODO(chuckjaz): do the right thing\n }\n return condition !;\n}\n\n/**\n * Implements the following hosts based on an api.CompilerHost:\n * - ts.CompilerHost to be consumed by a ts.Program\n * - AotCompilerHost for @angular/compiler\n * - TypeCheckHost for mapping ts errors to ng errors (via translateDiagnostics)\n */\nexport class TsCompilerAotCompilerTypeCheckHostAdapter implements ts.CompilerHost, AotCompilerHost,\n TypeCheckHost {\n private metadataReaderCache = createMetadataReaderCache();\n private flatModuleIndexCache = new Map<string, boolean>();\n private flatModuleIndexNames = new Set<string>();\n private flatModuleIndexRedirectNames = new Set<string>();\n private rootDirs: string[];\n private moduleResolutionCache: ts.ModuleResolutionCache;\n private originalSourceFiles = new Map<string, ts.SourceFile|null>();\n private originalFileExistsCache = new Map<string, boolean>();\n private generatedSourceFiles = new Map<string, GenSourceFile>();\n private generatedCodeFor = new Map<string, string[]>();\n private emitter = new TypeScriptEmitter();\n private metadataReaderHost: MetadataReaderHost;\n\n getCancellationToken: () => ts.CancellationToken;\n getDefaultLibLocation: () => string;\n trace: (s: string) => void;\n getDirectories: (path: string) => string[];\n directoryExists?: (directoryName: string) => boolean;\n\n constructor(\n private rootFiles: ReadonlyArray<string>, private options: CompilerOptions,\n private context: CompilerHost, private metadataProvider: MetadataProvider,\n private codeGenerator: CodeGenerator,\n private librarySummaries = new Map<string, LibrarySummary>()) {\n this.moduleResolutionCache = ts.createModuleResolutionCache(\n this.context.getCurrentDirectory !(), this.context.getCanonicalFileName.bind(this.context));\n const basePath = this.options.basePath !;\n this.rootDirs =\n (this.options.rootDirs || [this.options.basePath !]).map(p => path.resolve(basePath, p));\n if (context.getDirectories) {\n this.getDirectories = path => context.getDirectories !(path);\n }\n if (context.directoryExists) {\n this.directoryExists = directoryName => context.directoryExists !(directoryName);\n }\n if (context.getCancellationToken) {\n this.getCancellationToken = () => context.getCancellationToken !();\n }\n if (context.getDefaultLibLocation) {\n this.getDefaultLibLocation = () => context.getDefaultLibLocation !();\n }\n if (context.trace) {\n this.trace = s => context.trace !(s);\n }\n if (context.fileNameToModuleName) {\n this.fileNameToModuleName = context.fileNameToModuleName.bind(context);\n }\n // Note: don't copy over context.moduleNameToFileName as we first\n // normalize undefined containingFile to a filled containingFile.\n if (context.resourceNameToFileName) {\n this.resourceNameToFileName = context.resourceNameToFileName.bind(context);\n }\n if (context.toSummaryFileName) {\n this.toSummaryFileName = context.toSummaryFileName.bind(context);\n }\n if (context.fromSummaryFileName) {\n this.fromSummaryFileName = context.fromSummaryFileName.bind(context);\n }\n this.metadataReaderHost = {\n cacheMetadata: () => true,\n getSourceFileMetadata: (filePath) => {\n const sf = this.getOriginalSourceFile(filePath);\n return sf ? this.metadataProvider.getMetadata(sf) : undefined;\n },\n fileExists: (filePath) => this.originalFileExists(filePath),\n readFile: (filePath) => assert(this.context.readFile(filePath)),\n };\n }\n\n private resolveModuleName(moduleName: string, containingFile: string): ts.ResolvedModule\n |undefined {\n const rm = ts.resolveModuleName(\n moduleName, containingFile.replace(/\\\\/g, '/'), this.options, this,\n this.moduleResolutionCache)\n .resolvedModule;\n if (rm && this.isSourceFile(rm.resolvedFileName) && DTS.test(rm.resolvedFileName)) {\n // Case: generateCodeForLibraries = true and moduleName is\n // a .d.ts file in a node_modules folder.\n // Need to set isExternalLibraryImport to false so that generated files for that file\n // are emitted.\n rm.isExternalLibraryImport = false;\n }\n return rm;\n }\n\n // Note: We implement this method so that TypeScript and Angular share the same\n // ts.ModuleResolutionCache\n // and that we can tell ts.Program about our different opinion about\n // ResolvedModule.isExternalLibraryImport\n // (see our isSourceFile method).\n resolveModuleNames(moduleNames: string[], containingFile: string): ts.ResolvedModule[] {\n // TODO(tbosch): this seems to be a typing error in TypeScript,\n // as it contains assertions that the result contains the same number of entries\n // as the given module names.\n return <ts.ResolvedModule[]>moduleNames.map(\n moduleName => this.resolveModuleName(moduleName, containingFile));\n }\n\n moduleNameToFileName(m: string, containingFile?: string): string|null {\n if (!containingFile) {\n if (m.indexOf('.') === 0) {\n throw new Error('Resolution of relative paths requires a containing file.');\n }\n // Any containing file gives the same result for absolute imports\n containingFile = this.rootFiles[0];\n }\n if (this.context.moduleNameToFileName) {\n return this.context.moduleNameToFileName(m, containingFile);\n }\n const resolved = this.resolveModuleName(m, containingFile);\n return resolved ? resolved.resolvedFileName : null;\n }\n\n /**\n * We want a moduleId that will appear in import statements in the generated code\n * which will be written to `containingFile`.\n *\n * Note that we also generate files for files in node_modules, as libraries\n * only ship .metadata.json files but not the generated code.\n *\n * Logic:\n * 1. if the importedFile and the containingFile are from the project sources\n * or from the same node_modules package, use a relative path\n * 2. if the importedFile is in a node_modules package,\n * use a path that starts with the package name.\n * 3. Error if the containingFile is in the node_modules package\n * and the importedFile is in the project soures,\n * as that is a violation of the principle that node_modules packages cannot\n * import project sources.\n */\n fileNameToModuleName(importedFile: string, containingFile: string): string {\n const originalImportedFile = importedFile;\n if (this.options.traceResolution) {\n console.error(\n 'fileNameToModuleName from containingFile', containingFile, 'to importedFile',\n importedFile);\n }\n\n // drop extension\n importedFile = importedFile.replace(EXT, '');\n const importedFilePackagName = getPackageName(importedFile);\n const containingFilePackageName = getPackageName(containingFile);\n\n let moduleName: string;\n if (importedFilePackagName === containingFilePackageName ||\n GENERATED_FILES.test(originalImportedFile)) {\n const rootedContainingFile = relativeToRootDirs(containingFile, this.rootDirs);\n const rootedImportedFile = relativeToRootDirs(importedFile, this.rootDirs);\n\n if (rootedContainingFile !== containingFile && rootedImportedFile !== importedFile) {\n // if both files are contained in the `rootDirs`, then strip the rootDirs\n containingFile = rootedContainingFile;\n importedFile = rootedImportedFile;\n }\n moduleName = dotRelative(path.dirname(containingFile), importedFile);\n } else if (importedFilePackagName) {\n moduleName = stripNodeModulesPrefix(importedFile);\n } else {\n throw new Error(\n `Trying to import a source file from a node_modules package: import ${originalImportedFile} from ${containingFile}`);\n }\n return moduleName;\n }\n\n resourceNameToFileName(resourceName: string, containingFile: string): string|null {\n // Note: we convert package paths into relative paths to be compatible with the the\n // previous implementation of UrlResolver.\n const firstChar = resourceName[0];\n if (firstChar === '/') {\n resourceName = resourceName.slice(1);\n } else if (firstChar !== '.') {\n resourceName = `./${resourceName}`;\n }\n const filePathWithNgResource =\n this.moduleNameToFileName(addNgResourceSuffix(resourceName), containingFile);\n return filePathWithNgResource ? stripNgResourceSuffix(filePathWithNgResource) : null;\n }\n\n toSummaryFileName(fileName: string, referringSrcFileName: string): string {\n return this.fileNameToModuleName(fileName, referringSrcFileName);\n }\n\n fromSummaryFileName(fileName: string, referringLibFileName: string): string {\n const resolved = this.moduleNameToFileName(fileName, referringLibFileName);\n if (!resolved) {\n throw new Error(`Could not resolve ${fileName} from ${referringLibFileName}`);\n }\n return resolved;\n }\n\n parseSourceSpanOf(fileName: string, line: number, character: number): ParseSourceSpan|null {\n const data = this.generatedSourceFiles.get(fileName);\n if (data && data.emitCtx) {\n return data.emitCtx.spanOf(line, character);\n }\n return null;\n }\n\n private getOriginalSourceFile(\n filePath: string, languageVersion?: ts.ScriptTarget,\n onError?: ((message: string) => void)|undefined): ts.SourceFile|null {\n // Note: we need the explicit check via `has` as we also cache results\n // that were null / undefined.\n if (this.originalSourceFiles.has(filePath)) {\n return this.originalSourceFiles.get(filePath) !;\n }\n if (!languageVersion) {\n languageVersion = this.options.target || ts.ScriptTarget.Latest;\n }\n // Note: This can also return undefined,\n // as the TS typings are not correct!\n const sf = this.context.getSourceFile(filePath, languageVersion, onError) || null;\n this.originalSourceFiles.set(filePath, sf);\n return sf;\n }\n\n updateGeneratedFile(genFile: GeneratedFile): ts.SourceFile {\n if (!genFile.stmts) {\n throw new Error(\n `Invalid Argument: Expected a GenerateFile with statements. ${genFile.genFileUrl}`);\n }\n const oldGenFile = this.generatedSourceFiles.get(genFile.genFileUrl);\n if (!oldGenFile) {\n throw new Error(`Illegal State: previous GeneratedFile not found for ${genFile.genFileUrl}.`);\n }\n const newRefs = genFileExternalReferences(genFile);\n const oldRefs = oldGenFile.externalReferences;\n let refsAreEqual = oldRefs.size === newRefs.size;\n if (refsAreEqual) {\n newRefs.forEach(r => refsAreEqual = refsAreEqual && oldRefs.has(r));\n }\n if (!refsAreEqual) {\n throw new Error(\n `Illegal State: external references changed in ${genFile.genFileUrl}.\\nOld: ${Array.from(oldRefs)}.\\nNew: ${Array.from(newRefs)}`);\n }\n return this.addGeneratedFile(genFile, newRefs);\n }\n\n private addGeneratedFile(genFile: GeneratedFile, externalReferences: Set<string>): ts.SourceFile {\n if (!genFile.stmts) {\n throw new Error(\n `Invalid Argument: Expected a GenerateFile with statements. ${genFile.genFileUrl}`);\n }\n const {sourceText, context} = this.emitter.emitStatementsAndContext(\n genFile.genFileUrl, genFile.stmts, /* preamble */ '',\n /* emitSourceMaps */ false);\n const sf = ts.createSourceFile(\n genFile.genFileUrl, sourceText, this.options.target || ts.ScriptTarget.Latest);\n if ((this.options.module === ts.ModuleKind.AMD || this.options.module === ts.ModuleKind.UMD) &&\n this.context.amdModuleName) {\n const moduleName = this.context.amdModuleName(sf);\n if (moduleName) sf.moduleName = moduleName;\n }\n this.generatedSourceFiles.set(genFile.genFileUrl, {\n sourceFile: sf,\n emitCtx: context, externalReferences,\n });\n return sf;\n }\n\n shouldGenerateFile(fileName: string): {generate: boolean, baseFileName?: string} {\n // TODO(tbosch): allow generating files that are not in the rootDir\n // See https://github.com/angular/angular/issues/19337\n if (!isInRootDir(fileName, this.options)) {\n return {generate: false};\n }\n const genMatch = GENERATED_FILES.exec(fileName);\n if (!genMatch) {\n return {generate: false};\n }\n const [, base, genSuffix, suffix] = genMatch;\n if (suffix !== 'ts' && suffix !== 'tsx') {\n return {generate: false};\n }\n let baseFileName: string|undefined;\n if (genSuffix.indexOf('ngstyle') >= 0) {\n // Note: ngstyle files have names like `afile.css.ngstyle.ts`\n if (!this.originalFileExists(base)) {\n return {generate: false};\n }\n } else {\n // Note: on-the-fly generated files always have a `.ts` suffix,\n // but the file from which we generated it can be a `.ts`/ `.tsx`/ `.d.ts`\n // (see options.generateCodeForLibraries).\n baseFileName = [`${base}.ts`, `${base}.tsx`, `${base}.d.ts`].find(\n baseFileName => this.isSourceFile(baseFileName) && this.originalFileExists(baseFileName));\n if (!baseFileName) {\n return {generate: false};\n }\n }\n return {generate: true, baseFileName};\n }\n\n shouldGenerateFilesFor(fileName: string) {\n // TODO(tbosch): allow generating files that are not in the rootDir\n // See https://github.com/angular/angular/issues/19337\n return !GENERATED_FILES.test(fileName) && this.isSourceFile(fileName) &&\n isInRootDir(fileName, this.options);\n }\n\n getSourceFile(\n fileName: string, languageVersion: ts.ScriptTarget,\n onError?: ((message: string) => void)|undefined): ts.SourceFile {\n // Note: Don't exit early in this method to make sure\n // we always have up to date references on the file!\n let genFileNames: string[] = [];\n let sf = this.getGeneratedFile(fileName);\n if (!sf) {\n const summary = this.librarySummaries.get(fileName);\n if (summary) {\n if (!summary.sourceFile) {\n summary.sourceFile = ts.createSourceFile(\n fileName, summary.text, this.options.target || ts.ScriptTarget.Latest);\n }\n sf = summary.sourceFile;\n genFileNames = [];\n }\n }\n if (!sf) {\n sf = this.getOriginalSourceFile(fileName);\n const cachedGenFiles = this.generatedCodeFor.get(fileName);\n if (cachedGenFiles) {\n genFileNames = cachedGenFiles;\n } else {\n if (!this.options.noResolve && this.shouldGenerateFilesFor(fileName)) {\n genFileNames = this.codeGenerator.findGeneratedFileNames(fileName).filter(\n fileName => this.shouldGenerateFile(fileName).generate);\n }\n this.generatedCodeFor.set(fileName, genFileNames);\n }\n }\n if (sf) {\n addReferencesToSourceFile(sf, genFileNames);\n }\n // TODO(tbosch): TypeScript's typings for getSourceFile are incorrect,\n // as it can very well return undefined.\n return sf !;\n }\n\n private getGeneratedFile(fileName: string): ts.SourceFile|null {\n const genSrcFile = this.generatedSourceFiles.get(fileName);\n if (genSrcFile) {\n return genSrcFile.sourceFile;\n }\n const {generate, baseFileName} = this.shouldGenerateFile(fileName);\n if (generate) {\n const genFile = this.codeGenerator.generateFile(fileName, baseFileName);\n return this.addGeneratedFile(genFile, genFileExternalReferences(genFile));\n }\n return null;\n }\n\n private originalFileExists(fileName: string): boolean {\n let fileExists = this.originalFileExistsCache.get(fileName);\n if (fileExists == null) {\n fileExists = this.context.fileExists(fileName);\n this.originalFileExistsCache.set(fileName, fileExists);\n }\n return fileExists;\n }\n\n fileExists(fileName: string): boolean {\n fileName = stripNgResourceSuffix(fileName);\n if (this.librarySummaries.has(fileName) || this.generatedSourceFiles.has(fileName)) {\n return true;\n }\n if (this.shouldGenerateFile(fileName).generate) {\n return true;\n }\n return this.originalFileExists(fileName);\n }\n\n loadSummary(filePath: string): string|null {\n const summary = this.librarySummaries.get(filePath);\n if (summary) {\n return summary.text;\n }\n if (this.originalFileExists(filePath)) {\n return assert(this.context.readFile(filePath));\n }\n return null;\n }\n\n isSourceFile(filePath: string): boolean {\n // Don't generate any files nor typecheck them\n // if skipTemplateCodegen is set and fullTemplateTypeCheck is not yet set,\n // for backwards compatibility.\n if (this.options.skipTemplateCodegen && !this.options.fullTemplateTypeCheck) {\n return false;\n }\n // If we have a summary from a previous compilation,\n // treat the file never as a source file.\n if (this.librarySummaries.has(filePath)) {\n return false;\n }\n if (GENERATED_FILES.test(filePath)) {\n return false;\n }\n if (this.options.generateCodeForLibraries === false && DTS.test(filePath)) {\n return false;\n }\n if (DTS.test(filePath)) {\n // Check for a bundle index.\n if (this.hasBundleIndex(filePath)) {\n const normalFilePath = path.normalize(filePath);\n return this.flatModuleIndexNames.has(normalFilePath) ||\n this.flatModuleIndexRedirectNames.has(normalFilePath);\n }\n }\n return true;\n }\n\n readFile(fileName: string) {\n const summary = this.librarySummaries.get(fileName);\n if (summary) {\n return summary.text;\n }\n return this.context.readFile(fileName);\n }\n\n getMetadataFor(filePath: string): ModuleMetadata[]|undefined {\n return readMetadata(filePath, this.metadataReaderHost, this.metadataReaderCache);\n }\n\n loadResource(filePath: string): Promise<string>|string {\n if (this.context.readResource) return this.context.readResource(filePath);\n if (!this.originalFileExists(filePath)) {\n throw syntaxError(`Error: Resource file not found: ${filePath}`);\n }\n return assert(this.context.readFile(filePath));\n }\n\n private hasBundleIndex(filePath: string): boolean {\n const checkBundleIndex = (directory: string): boolean => {\n let result = this.flatModuleIndexCache.get(directory);\n if (result == null) {\n if (path.basename(directory) == 'node_module') {\n // Don't look outside the node_modules this package is installed in.\n result = false;\n } else {\n // A bundle index exists if the typings .d.ts file has a metadata.json that has an\n // importAs.\n try {\n const packageFile = path.join(directory, 'package.json');\n if (this.originalFileExists(packageFile)) {\n // Once we see a package.json file, assume false until it we find the bundle index.\n result = false;\n const packageContent: any = JSON.parse(assert(this.context.readFile(packageFile)));\n if (packageContent.typings) {\n const typings = path.normalize(path.join(directory, packageContent.typings));\n if (DTS.test(typings)) {\n const metadataFile = typings.replace(DTS, '.metadata.json');\n if (this.originalFileExists(metadataFile)) {\n const metadata = JSON.parse(assert(this.context.readFile(metadataFile)));\n if (metadata.flatModuleIndexRedirect) {\n this.flatModuleIndexRedirectNames.add(typings);\n // Note: don't set result = true,\n // as this would mark this folder\n // as having a bundleIndex too early without\n // filling the bundleIndexNames.\n } else if (metadata.importAs) {\n this.flatModuleIndexNames.add(typings);\n result = true;\n }\n }\n }\n }\n } else {\n const parent = path.dirname(directory);\n if (parent != directory) {\n // Try the parent directory.\n result = checkBundleIndex(parent);\n } else {\n result = false;\n }\n }\n } catch (e) {\n // If we encounter any errors assume we this isn't a bundle index.\n result = false;\n }\n }\n this.flatModuleIndexCache.set(directory, result);\n }\n return result;\n };\n\n return checkBundleIndex(path.dirname(filePath));\n }\n\n getDefaultLibFileName = (options: ts.CompilerOptions) =>\n this.context.getDefaultLibFileName(options)\n getCurrentDirectory = () => this.context.getCurrentDirectory();\n getCanonicalFileName = (fileName: string) => this.context.getCanonicalFileName(fileName);\n useCaseSensitiveFileNames = () => this.context.useCaseSensitiveFileNames();\n getNewLine = () => this.context.getNewLine();\n // Make sure we do not `host.realpath()` from TS as we do not want to resolve symlinks.\n // https://github.com/Microsoft/TypeScript/issues/9552\n realPath = (p: string) => p;\n writeFile = this.context.writeFile.bind(this.context);\n}\n\nfunction genFileExternalReferences(genFile: GeneratedFile): Set<string> {\n return new Set(collectExternalReferences(genFile.stmts !).map(er => er.moduleName !));\n}\n\nfunction addReferencesToSourceFile(sf: ts.SourceFile, genFileNames: string[]) {\n // Note: as we modify ts.SourceFiles we need to keep the original\n // value for `referencedFiles` around in cache the original host is caching ts.SourceFiles.\n // Note: cloning the ts.SourceFile is expensive as the nodes in have parent pointers,\n // i.e. we would also need to clone and adjust all nodes.\n let originalReferencedFiles: ReadonlyArray<ts.FileReference> =\n (sf as any).originalReferencedFiles;\n if (!originalReferencedFiles) {\n originalReferencedFiles = sf.referencedFiles;\n (sf as any).originalReferencedFiles = originalReferencedFiles;\n }\n const newReferencedFiles = [...originalReferencedFiles];\n genFileNames.forEach(gf => newReferencedFiles.push({fileName: gf, pos: 0, end: 0}));\n sf.referencedFiles = newReferencedFiles;\n}\n\nexport function getOriginalReferences(sourceFile: ts.SourceFile): ts.FileReference[]|undefined {\n return sourceFile && (sourceFile as any).originalReferencedFiles;\n}\n\nfunction dotRelative(from: string, to: string): string {\n const rPath: string = path.relative(from, to).replace(/\\\\/g, '/');\n return rPath.startsWith('.') ? rPath : './' + rPath;\n}\n\n/**\n * Moves the path into `genDir` folder while preserving the `node_modules` directory.\n */\nfunction getPackageName(filePath: string): string|null {\n const match = NODE_MODULES_PACKAGE_NAME.exec(filePath);\n return match ? match[1] : null;\n}\n\nfunction stripNodeModulesPrefix(filePath: string): string {\n return filePath.replace(/.*node_modules\\//, '');\n}\n\nfunction getNodeModulesPrefix(filePath: string): string|null {\n const match = /.*node_modules\\//.exec(filePath);\n return match ? match[1] : null;\n}\n\nfunction stripNgResourceSuffix(fileName: string): string {\n return fileName.replace(/\\.\\$ngresource\\$.*/, '');\n}\n\nfunction addNgResourceSuffix(fileName: string): string {\n return `${fileName}.$ngresource$`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compiler_host.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/transformers/compiler_host.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,8CAAuL;AACvL,2BAA6B;AAC7B,+BAAiC;AAMjC,qDAA8F;AAC9F,+BAA6E;AAE7E,IAAM,yBAAyB,GAAG,6CAA6C,CAAC;AAChF,IAAM,GAAG,GAAG,kCAAkC,CAAC;AAE/C,4BACI,EACwD;QADvD,oBAAO,EAAE,cAA6C,EAA7C,kEAA6C;IAEzD,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC;AAJD,gDAIC;AAiBD,gBAAmB,SAA+B;IAChD,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QACf,qCAAqC;IACvC,CAAC;IACD,MAAM,CAAC,SAAW,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH;IAqBE,mDACY,SAAgC,EAAU,OAAwB,EAClE,OAAqB,EAAU,gBAAkC,EACjE,aAA4B,EAC5B,gBAAoD;QAApD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C,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,wBAAwB,QAAgB;IACtC,IAAM,KAAK,GAAG,yBAAyB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,gCAAgC,QAAgB;IAC9C,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,8BAA8B,QAAgB;IAC5C,IAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,+BAA+B,QAAgB;IAC7C,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,6BAA6B,QAAgB;IAC3C,MAAM,CAAI,QAAQ,kBAAe,CAAC;AACpC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AotCompilerHost, EmitterVisitorContext, ExternalReference, GeneratedFile, ParseSourceSpan, TypeScriptEmitter, collectExternalReferences, syntaxError} from '@angular/compiler';\nimport * as path from 'path';\nimport * as ts from 'typescript';\n\nimport {TypeCheckHost} from '../diagnostics/translate_diagnostics';\nimport {METADATA_VERSION, ModuleMetadata} from '../metadata/index';\n\nimport {CompilerHost, CompilerOptions, LibrarySummary} from './api';\nimport {MetadataReaderHost, createMetadataReaderCache, readMetadata} from './metadata_reader';\nimport {DTS, GENERATED_FILES, isInRootDir, relativeToRootDirs} from './util';\n\nconst NODE_MODULES_PACKAGE_NAME = /node_modules\\/((\\w|-)+|(@(\\w|-)+\\/(\\w|-)+))/;\nconst EXT = /(\\.ts|\\.d\\.ts|\\.js|\\.jsx|\\.tsx)$/;\n\nexport function createCompilerHost(\n {options, tsHost = ts.createCompilerHost(options, true)}:\n {options: CompilerOptions, tsHost?: ts.CompilerHost}): CompilerHost {\n return tsHost;\n}\n\nexport interface MetadataProvider {\n getMetadata(sourceFile: ts.SourceFile): ModuleMetadata|undefined;\n}\n\ninterface GenSourceFile {\n externalReferences: Set<string>;\n sourceFile: ts.SourceFile;\n emitCtx: EmitterVisitorContext;\n}\n\nexport interface CodeGenerator {\n generateFile(genFileName: string, baseFileName?: string): GeneratedFile;\n findGeneratedFileNames(fileName: string): string[];\n}\n\nfunction assert<T>(condition: T | null | undefined) {\n if (!condition) {\n // TODO(chuckjaz): do the right thing\n }\n return condition !;\n}\n\n/**\n * Implements the following hosts based on an api.CompilerHost:\n * - ts.CompilerHost to be consumed by a ts.Program\n * - AotCompilerHost for @angular/compiler\n * - TypeCheckHost for mapping ts errors to ng errors (via translateDiagnostics)\n */\nexport class TsCompilerAotCompilerTypeCheckHostAdapter implements ts.CompilerHost, AotCompilerHost,\n TypeCheckHost {\n private metadataReaderCache = createMetadataReaderCache();\n private flatModuleIndexCache = new Map<string, boolean>();\n private flatModuleIndexNames = new Set<string>();\n private flatModuleIndexRedirectNames = new Set<string>();\n private rootDirs: string[];\n private moduleResolutionCache: ts.ModuleResolutionCache;\n private originalSourceFiles = new Map<string, ts.SourceFile|null>();\n private originalFileExistsCache = new Map<string, boolean>();\n private generatedSourceFiles = new Map<string, GenSourceFile>();\n private generatedCodeFor = new Map<string, string[]>();\n private emitter = new TypeScriptEmitter();\n private metadataReaderHost: MetadataReaderHost;\n\n getCancellationToken: () => ts.CancellationToken;\n getDefaultLibLocation: () => string;\n trace: (s: string) => void;\n getDirectories: (path: string) => string[];\n directoryExists?: (directoryName: string) => boolean;\n\n constructor(\n private rootFiles: ReadonlyArray<string>, private options: CompilerOptions,\n private context: CompilerHost, private metadataProvider: MetadataProvider,\n private codeGenerator: CodeGenerator,\n private librarySummaries = new Map<string, LibrarySummary>()) {\n this.moduleResolutionCache = ts.createModuleResolutionCache(\n this.context.getCurrentDirectory !(), this.context.getCanonicalFileName.bind(this.context));\n const basePath = this.options.basePath !;\n this.rootDirs =\n (this.options.rootDirs || [this.options.basePath !]).map(p => path.resolve(basePath, p));\n if (context.getDirectories) {\n this.getDirectories = path => context.getDirectories !(path);\n }\n if (context.directoryExists) {\n this.directoryExists = directoryName => context.directoryExists !(directoryName);\n }\n if (context.getCancellationToken) {\n this.getCancellationToken = () => context.getCancellationToken !();\n }\n if (context.getDefaultLibLocation) {\n this.getDefaultLibLocation = () => context.getDefaultLibLocation !();\n }\n if (context.trace) {\n this.trace = s => context.trace !(s);\n }\n if (context.fileNameToModuleName) {\n this.fileNameToModuleName = context.fileNameToModuleName.bind(context);\n }\n // Note: don't copy over context.moduleNameToFileName as we first\n // normalize undefined containingFile to a filled containingFile.\n if (context.resourceNameToFileName) {\n this.resourceNameToFileName = context.resourceNameToFileName.bind(context);\n }\n if (context.toSummaryFileName) {\n this.toSummaryFileName = context.toSummaryFileName.bind(context);\n }\n if (context.fromSummaryFileName) {\n this.fromSummaryFileName = context.fromSummaryFileName.bind(context);\n }\n this.metadataReaderHost = {\n cacheMetadata: () => true,\n getSourceFileMetadata: (filePath) => {\n const sf = this.getOriginalSourceFile(filePath);\n return sf ? this.metadataProvider.getMetadata(sf) : undefined;\n },\n fileExists: (filePath) => this.originalFileExists(filePath),\n readFile: (filePath) => assert(this.context.readFile(filePath)),\n };\n }\n\n private resolveModuleName(moduleName: string, containingFile: string): ts.ResolvedModule\n |undefined {\n const rm = ts.resolveModuleName(\n moduleName, containingFile.replace(/\\\\/g, '/'), this.options, this,\n this.moduleResolutionCache)\n .resolvedModule;\n if (rm && this.isSourceFile(rm.resolvedFileName) && DTS.test(rm.resolvedFileName)) {\n // Case: generateCodeForLibraries = true and moduleName is\n // a .d.ts file in a node_modules folder.\n // Need to set isExternalLibraryImport to false so that generated files for that file\n // are emitted.\n rm.isExternalLibraryImport = false;\n }\n return rm;\n }\n\n // Note: We implement this method so that TypeScript and Angular share the same\n // ts.ModuleResolutionCache\n // and that we can tell ts.Program about our different opinion about\n // ResolvedModule.isExternalLibraryImport\n // (see our isSourceFile method).\n resolveModuleNames(moduleNames: string[], containingFile: string): ts.ResolvedModule[] {\n // TODO(tbosch): this seems to be a typing error in TypeScript,\n // as it contains assertions that the result contains the same number of entries\n // as the given module names.\n return <ts.ResolvedModule[]>moduleNames.map(\n moduleName => this.resolveModuleName(moduleName, containingFile));\n }\n\n moduleNameToFileName(m: string, containingFile?: string): string|null {\n if (!containingFile) {\n if (m.indexOf('.') === 0) {\n throw new Error('Resolution of relative paths requires a containing file.');\n }\n // Any containing file gives the same result for absolute imports\n containingFile = this.rootFiles[0];\n }\n if (this.context.moduleNameToFileName) {\n return this.context.moduleNameToFileName(m, containingFile);\n }\n const resolved = this.resolveModuleName(m, containingFile);\n return resolved ? resolved.resolvedFileName : null;\n }\n\n /**\n * We want a moduleId that will appear in import statements in the generated code\n * which will be written to `containingFile`.\n *\n * Note that we also generate files for files in node_modules, as libraries\n * only ship .metadata.json files but not the generated code.\n *\n * Logic:\n * 1. if the importedFile and the containingFile are from the project sources\n * or from the same node_modules package, use a relative path\n * 2. if the importedFile is in a node_modules package,\n * use a path that starts with the package name.\n * 3. Error if the containingFile is in the node_modules package\n * and the importedFile is in the project soures,\n * as that is a violation of the principle that node_modules packages cannot\n * import project sources.\n */\n fileNameToModuleName(importedFile: string, containingFile: string): string {\n const originalImportedFile = importedFile;\n if (this.options.traceResolution) {\n console.error(\n 'fileNameToModuleName from containingFile', containingFile, 'to importedFile',\n importedFile);\n }\n\n // drop extension\n importedFile = importedFile.replace(EXT, '');\n const importedFilePackagName = getPackageName(importedFile);\n const containingFilePackageName = getPackageName(containingFile);\n\n let moduleName: string;\n if (importedFilePackagName === containingFilePackageName ||\n GENERATED_FILES.test(originalImportedFile)) {\n const rootedContainingFile = relativeToRootDirs(containingFile, this.rootDirs);\n const rootedImportedFile = relativeToRootDirs(importedFile, this.rootDirs);\n\n if (rootedContainingFile !== containingFile && rootedImportedFile !== importedFile) {\n // if both files are contained in the `rootDirs`, then strip the rootDirs\n containingFile = rootedContainingFile;\n importedFile = rootedImportedFile;\n }\n moduleName = dotRelative(path.dirname(containingFile), importedFile);\n } else if (importedFilePackagName) {\n moduleName = stripNodeModulesPrefix(importedFile);\n } else {\n throw new Error(\n `Trying to import a source file from a node_modules package: import ${originalImportedFile} from ${containingFile}`);\n }\n return moduleName;\n }\n\n resourceNameToFileName(resourceName: string, containingFile: string): string|null {\n // Note: we convert package paths into relative paths to be compatible with the the\n // previous implementation of UrlResolver.\n const firstChar = resourceName[0];\n if (firstChar === '/') {\n resourceName = resourceName.slice(1);\n } else if (firstChar !== '.') {\n resourceName = `./${resourceName}`;\n }\n const filePathWithNgResource =\n this.moduleNameToFileName(addNgResourceSuffix(resourceName), containingFile);\n return filePathWithNgResource ? stripNgResourceSuffix(filePathWithNgResource) : null;\n }\n\n toSummaryFileName(fileName: string, referringSrcFileName: string): string {\n return this.fileNameToModuleName(fileName, referringSrcFileName);\n }\n\n fromSummaryFileName(fileName: string, referringLibFileName: string): string {\n const resolved = this.moduleNameToFileName(fileName, referringLibFileName);\n if (!resolved) {\n throw new Error(`Could not resolve ${fileName} from ${referringLibFileName}`);\n }\n return resolved;\n }\n\n parseSourceSpanOf(fileName: string, line: number, character: number): ParseSourceSpan|null {\n const data = this.generatedSourceFiles.get(fileName);\n if (data && data.emitCtx) {\n return data.emitCtx.spanOf(line, character);\n }\n return null;\n }\n\n private getOriginalSourceFile(\n filePath: string, languageVersion?: ts.ScriptTarget,\n onError?: ((message: string) => void)|undefined): ts.SourceFile|null {\n // Note: we need the explicit check via `has` as we also cache results\n // that were null / undefined.\n if (this.originalSourceFiles.has(filePath)) {\n return this.originalSourceFiles.get(filePath) !;\n }\n if (!languageVersion) {\n languageVersion = this.options.target || ts.ScriptTarget.Latest;\n }\n // Note: This can also return undefined,\n // as the TS typings are not correct!\n const sf = this.context.getSourceFile(filePath, languageVersion, onError) || null;\n this.originalSourceFiles.set(filePath, sf);\n return sf;\n }\n\n updateGeneratedFile(genFile: GeneratedFile): ts.SourceFile {\n if (!genFile.stmts) {\n throw new Error(\n `Invalid Argument: Expected a GenerateFile with statements. ${genFile.genFileUrl}`);\n }\n const oldGenFile = this.generatedSourceFiles.get(genFile.genFileUrl);\n if (!oldGenFile) {\n throw new Error(`Illegal State: previous GeneratedFile not found for ${genFile.genFileUrl}.`);\n }\n const newRefs = genFileExternalReferences(genFile);\n const oldRefs = oldGenFile.externalReferences;\n let refsAreEqual = oldRefs.size === newRefs.size;\n if (refsAreEqual) {\n newRefs.forEach(r => refsAreEqual = refsAreEqual && oldRefs.has(r));\n }\n if (!refsAreEqual) {\n throw new Error(\n `Illegal State: external references changed in ${genFile.genFileUrl}.\\nOld: ${Array.from(oldRefs)}.\\nNew: ${Array.from(newRefs)}`);\n }\n return this.addGeneratedFile(genFile, newRefs);\n }\n\n private addGeneratedFile(genFile: GeneratedFile, externalReferences: Set<string>): ts.SourceFile {\n if (!genFile.stmts) {\n throw new Error(\n `Invalid Argument: Expected a GenerateFile with statements. ${genFile.genFileUrl}`);\n }\n const {sourceText, context} = this.emitter.emitStatementsAndContext(\n genFile.genFileUrl, genFile.stmts, /* preamble */ '',\n /* emitSourceMaps */ false);\n const sf = ts.createSourceFile(\n genFile.genFileUrl, sourceText, this.options.target || ts.ScriptTarget.Latest);\n if ((this.options.module === ts.ModuleKind.AMD || this.options.module === ts.ModuleKind.UMD) &&\n this.context.amdModuleName) {\n const moduleName = this.context.amdModuleName(sf);\n if (moduleName) sf.moduleName = moduleName;\n }\n this.generatedSourceFiles.set(genFile.genFileUrl, {\n sourceFile: sf,\n emitCtx: context, externalReferences,\n });\n return sf;\n }\n\n shouldGenerateFile(fileName: string): {generate: boolean, baseFileName?: string} {\n // TODO(tbosch): allow generating files that are not in the rootDir\n // See https://github.com/angular/angular/issues/19337\n if (!isInRootDir(fileName, this.options)) {\n return {generate: false};\n }\n const genMatch = GENERATED_FILES.exec(fileName);\n if (!genMatch) {\n return {generate: false};\n }\n const [, base, genSuffix, suffix] = genMatch;\n if (suffix !== 'ts' && suffix !== 'tsx') {\n return {generate: false};\n }\n let baseFileName: string|undefined;\n if (genSuffix.indexOf('ngstyle') >= 0) {\n // Note: ngstyle files have names like `afile.css.ngstyle.ts`\n if (!this.originalFileExists(base)) {\n return {generate: false};\n }\n } else {\n // Note: on-the-fly generated files always have a `.ts` suffix,\n // but the file from which we generated it can be a `.ts`/ `.tsx`/ `.d.ts`\n // (see options.generateCodeForLibraries).\n baseFileName = [`${base}.ts`, `${base}.tsx`, `${base}.d.ts`].find(\n baseFileName => this.isSourceFile(baseFileName) && this.originalFileExists(baseFileName));\n if (!baseFileName) {\n return {generate: false};\n }\n }\n return {generate: true, baseFileName};\n }\n\n shouldGenerateFilesFor(fileName: string) {\n // TODO(tbosch): allow generating files that are not in the rootDir\n // See https://github.com/angular/angular/issues/19337\n return !GENERATED_FILES.test(fileName) && this.isSourceFile(fileName) &&\n isInRootDir(fileName, this.options);\n }\n\n getSourceFile(\n fileName: string, languageVersion: ts.ScriptTarget,\n onError?: ((message: string) => void)|undefined): ts.SourceFile {\n // Note: Don't exit early in this method to make sure\n // we always have up to date references on the file!\n let genFileNames: string[] = [];\n let sf = this.getGeneratedFile(fileName);\n if (!sf) {\n const summary = this.librarySummaries.get(fileName);\n if (summary) {\n if (!summary.sourceFile) {\n summary.sourceFile = ts.createSourceFile(\n fileName, summary.text, this.options.target || ts.ScriptTarget.Latest);\n }\n sf = summary.sourceFile;\n genFileNames = [];\n }\n }\n if (!sf) {\n sf = this.getOriginalSourceFile(fileName);\n const cachedGenFiles = this.generatedCodeFor.get(fileName);\n if (cachedGenFiles) {\n genFileNames = cachedGenFiles;\n } else {\n if (!this.options.noResolve && this.shouldGenerateFilesFor(fileName)) {\n genFileNames = this.codeGenerator.findGeneratedFileNames(fileName).filter(\n fileName => this.shouldGenerateFile(fileName).generate);\n }\n this.generatedCodeFor.set(fileName, genFileNames);\n }\n }\n if (sf) {\n addReferencesToSourceFile(sf, genFileNames);\n }\n // TODO(tbosch): TypeScript's typings for getSourceFile are incorrect,\n // as it can very well return undefined.\n return sf !;\n }\n\n private getGeneratedFile(fileName: string): ts.SourceFile|null {\n const genSrcFile = this.generatedSourceFiles.get(fileName);\n if (genSrcFile) {\n return genSrcFile.sourceFile;\n }\n const {generate, baseFileName} = this.shouldGenerateFile(fileName);\n if (generate) {\n const genFile = this.codeGenerator.generateFile(fileName, baseFileName);\n return this.addGeneratedFile(genFile, genFileExternalReferences(genFile));\n }\n return null;\n }\n\n private originalFileExists(fileName: string): boolean {\n let fileExists = this.originalFileExistsCache.get(fileName);\n if (fileExists == null) {\n fileExists = this.context.fileExists(fileName);\n this.originalFileExistsCache.set(fileName, fileExists);\n }\n return fileExists;\n }\n\n fileExists(fileName: string): boolean {\n fileName = stripNgResourceSuffix(fileName);\n if (this.librarySummaries.has(fileName) || this.generatedSourceFiles.has(fileName)) {\n return true;\n }\n if (this.shouldGenerateFile(fileName).generate) {\n return true;\n }\n return this.originalFileExists(fileName);\n }\n\n loadSummary(filePath: string): string|null {\n const summary = this.librarySummaries.get(filePath);\n if (summary) {\n return summary.text;\n }\n if (this.originalFileExists(filePath)) {\n return assert(this.context.readFile(filePath));\n }\n return null;\n }\n\n isSourceFile(filePath: string): boolean {\n // Don't generate any files nor typecheck them\n // if skipTemplateCodegen is set and fullTemplateTypeCheck is not yet set,\n // for backwards compatibility.\n if (this.options.skipTemplateCodegen && !this.options.fullTemplateTypeCheck) {\n return false;\n }\n // If we have a summary from a previous compilation,\n // treat the file never as a source file.\n if (this.librarySummaries.has(filePath)) {\n return false;\n }\n if (GENERATED_FILES.test(filePath)) {\n return false;\n }\n if (this.options.generateCodeForLibraries === false && DTS.test(filePath)) {\n return false;\n }\n if (DTS.test(filePath)) {\n // Check for a bundle index.\n if (this.hasBundleIndex(filePath)) {\n const normalFilePath = path.normalize(filePath);\n return this.flatModuleIndexNames.has(normalFilePath) ||\n this.flatModuleIndexRedirectNames.has(normalFilePath);\n }\n }\n return true;\n }\n\n readFile(fileName: string) {\n const summary = this.librarySummaries.get(fileName);\n if (summary) {\n return summary.text;\n }\n return this.context.readFile(fileName);\n }\n\n getMetadataFor(filePath: string): ModuleMetadata[]|undefined {\n return readMetadata(filePath, this.metadataReaderHost, this.metadataReaderCache);\n }\n\n loadResource(filePath: string): Promise<string>|string {\n if (this.context.readResource) return this.context.readResource(filePath);\n if (!this.originalFileExists(filePath)) {\n throw syntaxError(`Error: Resource file not found: ${filePath}`);\n }\n return assert(this.context.readFile(filePath));\n }\n\n getOutputName(filePath: string): string {\n return path.relative(this.getCurrentDirectory(), filePath);\n }\n\n private hasBundleIndex(filePath: string): boolean {\n const checkBundleIndex = (directory: string): boolean => {\n let result = this.flatModuleIndexCache.get(directory);\n if (result == null) {\n if (path.basename(directory) == 'node_module') {\n // Don't look outside the node_modules this package is installed in.\n result = false;\n } else {\n // A bundle index exists if the typings .d.ts file has a metadata.json that has an\n // importAs.\n try {\n const packageFile = path.join(directory, 'package.json');\n if (this.originalFileExists(packageFile)) {\n // Once we see a package.json file, assume false until it we find the bundle index.\n result = false;\n const packageContent: any = JSON.parse(assert(this.context.readFile(packageFile)));\n if (packageContent.typings) {\n const typings = path.normalize(path.join(directory, packageContent.typings));\n if (DTS.test(typings)) {\n const metadataFile = typings.replace(DTS, '.metadata.json');\n if (this.originalFileExists(metadataFile)) {\n const metadata = JSON.parse(assert(this.context.readFile(metadataFile)));\n if (metadata.flatModuleIndexRedirect) {\n this.flatModuleIndexRedirectNames.add(typings);\n // Note: don't set result = true,\n // as this would mark this folder\n // as having a bundleIndex too early without\n // filling the bundleIndexNames.\n } else if (metadata.importAs) {\n this.flatModuleIndexNames.add(typings);\n result = true;\n }\n }\n }\n }\n } else {\n const parent = path.dirname(directory);\n if (parent != directory) {\n // Try the parent directory.\n result = checkBundleIndex(parent);\n } else {\n result = false;\n }\n }\n } catch (e) {\n // If we encounter any errors assume we this isn't a bundle index.\n result = false;\n }\n }\n this.flatModuleIndexCache.set(directory, result);\n }\n return result;\n };\n\n return checkBundleIndex(path.dirname(filePath));\n }\n\n getDefaultLibFileName = (options: ts.CompilerOptions) =>\n this.context.getDefaultLibFileName(options)\n getCurrentDirectory = () => this.context.getCurrentDirectory();\n getCanonicalFileName = (fileName: string) => this.context.getCanonicalFileName(fileName);\n useCaseSensitiveFileNames = () => this.context.useCaseSensitiveFileNames();\n getNewLine = () => this.context.getNewLine();\n // Make sure we do not `host.realpath()` from TS as we do not want to resolve symlinks.\n // https://github.com/Microsoft/TypeScript/issues/9552\n realPath = (p: string) => p;\n writeFile = this.context.writeFile.bind(this.context);\n}\n\nfunction genFileExternalReferences(genFile: GeneratedFile): Set<string> {\n return new Set(collectExternalReferences(genFile.stmts !).map(er => er.moduleName !));\n}\n\nfunction addReferencesToSourceFile(sf: ts.SourceFile, genFileNames: string[]) {\n // Note: as we modify ts.SourceFiles we need to keep the original\n // value for `referencedFiles` around in cache the original host is caching ts.SourceFiles.\n // Note: cloning the ts.SourceFile is expensive as the nodes in have parent pointers,\n // i.e. we would also need to clone and adjust all nodes.\n let originalReferencedFiles: ReadonlyArray<ts.FileReference> =\n (sf as any).originalReferencedFiles;\n if (!originalReferencedFiles) {\n originalReferencedFiles = sf.referencedFiles;\n (sf as any).originalReferencedFiles = originalReferencedFiles;\n }\n const newReferencedFiles = [...originalReferencedFiles];\n genFileNames.forEach(gf => newReferencedFiles.push({fileName: gf, pos: 0, end: 0}));\n sf.referencedFiles = newReferencedFiles;\n}\n\nexport function getOriginalReferences(sourceFile: ts.SourceFile): ts.FileReference[]|undefined {\n return sourceFile && (sourceFile as any).originalReferencedFiles;\n}\n\nfunction dotRelative(from: string, to: string): string {\n const rPath: string = path.relative(from, to).replace(/\\\\/g, '/');\n return rPath.startsWith('.') ? rPath : './' + rPath;\n}\n\n/**\n * Moves the path into `genDir` folder while preserving the `node_modules` directory.\n */\nfunction getPackageName(filePath: string): string|null {\n const match = NODE_MODULES_PACKAGE_NAME.exec(filePath);\n return match ? match[1] : null;\n}\n\nfunction stripNodeModulesPrefix(filePath: string): string {\n return filePath.replace(/.*node_modules\\//, '');\n}\n\nfunction getNodeModulesPrefix(filePath: string): string|null {\n const match = /.*node_modules\\//.exec(filePath);\n return match ? match[1] : null;\n}\n\nfunction stripNgResourceSuffix(fileName: string): string {\n return fileName.replace(/\\.\\$ngresource\\$.*/, '');\n}\n\nfunction addNgResourceSuffix(fileName: string): string {\n return `${fileName}.$ngresource$`;\n}\n"]}
|
|
@@ -257,10 +257,11 @@ var LowerMetadataCache = /** @class */ (function () {
|
|
|
257
257
|
return value;
|
|
258
258
|
};
|
|
259
259
|
// Do not validate or lower metadata in a declaration file. Declaration files are requested
|
|
260
|
-
// when we need to update the version of the metadata to add
|
|
260
|
+
// when we need to update the version of the metadata to add information that might be missing
|
|
261
261
|
// in the out-of-date version that can be recovered from the .d.ts file.
|
|
262
262
|
var declarationFile = sourceFile.isDeclarationFile;
|
|
263
|
-
var
|
|
263
|
+
var moduleFile = ts.isExternalModule(sourceFile);
|
|
264
|
+
var metadata = this.collector.getMetadata(sourceFile, this.strict && !declarationFile, moduleFile && !declarationFile ? substituteExpression : undefined);
|
|
264
265
|
return { metadata: metadata, requests: requests };
|
|
265
266
|
};
|
|
266
267
|
return LowerMetadataCache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lower_expressions.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/transformers/lower_expressions.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,8CAAuE;AACvE,+BAAiC;AAEjC,2CAA0I;AAwB1I,eAAqB,KAAU,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QACL,CAAC;IACH,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,WAAW,CAAC;AACrB,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {createLoweredSymbol, isLoweredSymbol} from '@angular/compiler';\nimport * as ts from 'typescript';\n\nimport {CollectorOptions, MetadataCollector, MetadataValue, ModuleMetadata, isMetadataGlobalReferenceExpression} from '../metadata/index';\n\nexport interface LoweringRequest {\n kind: ts.SyntaxKind;\n location: number;\n end: number;\n name: string;\n}\n\nexport type RequestLocationMap = Map<number, LoweringRequest>;\n\nconst enum DeclarationOrder { BeforeStmt, AfterStmt }\n\ninterface Declaration {\n name: string;\n node: ts.Node;\n order: DeclarationOrder;\n}\n\ninterface DeclarationInsert {\n declarations: Declaration[];\n relativeTo: ts.Node;\n}\n\nfunction toMap<T, K>(items: T[], select: (item: T) => K): Map<K, T> {\n return new Map(items.map<[K, T]>(i => [select(i), i]));\n}\n\n// We will never lower expressions in a nested lexical scope so avoid entering them.\n// This also avoids a bug in TypeScript 2.3 where the lexical scopes get out of sync\n// when using visitEachChild.\nfunction isLexicalScope(node: ts.Node): boolean {\n switch (node.kind) {\n case ts.SyntaxKind.ArrowFunction:\n case ts.SyntaxKind.FunctionExpression:\n case ts.SyntaxKind.FunctionDeclaration:\n case ts.SyntaxKind.ClassExpression:\n case ts.SyntaxKind.ClassDeclaration:\n case ts.SyntaxKind.FunctionType:\n case ts.SyntaxKind.TypeLiteral:\n case ts.SyntaxKind.ArrayType:\n return true;\n }\n return false;\n}\n\nfunction transformSourceFile(\n sourceFile: ts.SourceFile, requests: RequestLocationMap,\n context: ts.TransformationContext): ts.SourceFile {\n const inserts: DeclarationInsert[] = [];\n\n // Calculate the range of interesting locations. The transform will only visit nodes in this\n // range to improve the performance on large files.\n const locations = Array.from(requests.keys());\n const min = Math.min(...locations);\n const max = Math.max(...locations);\n\n // Visit nodes matching the request and synthetic nodes added by tsickle\n function shouldVisit(pos: number, end: number): boolean {\n return (pos <= max && end >= min) || pos == -1;\n }\n\n function visitSourceFile(sourceFile: ts.SourceFile): ts.SourceFile {\n function topLevelStatement(node: ts.Statement): ts.Statement {\n const declarations: Declaration[] = [];\n\n function visitNode(node: ts.Node): ts.Node {\n // Get the original node before tsickle\n const {pos, end, kind, parent: originalParent} = ts.getOriginalNode(node);\n const nodeRequest = requests.get(pos);\n if (nodeRequest && nodeRequest.kind == kind && nodeRequest.end == end) {\n // This node is requested to be rewritten as a reference to the exported name.\n if (originalParent && originalParent.kind === ts.SyntaxKind.VariableDeclaration) {\n // As the value represents the whole initializer of a variable declaration,\n // just refer to that variable. This e.g. helps to preserve closure comments\n // at the right place.\n const varParent = originalParent as ts.VariableDeclaration;\n if (varParent.name.kind === ts.SyntaxKind.Identifier) {\n const varName = varParent.name.text;\n const exportName = nodeRequest.name;\n declarations.push({\n name: exportName,\n node: ts.createIdentifier(varName),\n order: DeclarationOrder.AfterStmt\n });\n return node;\n }\n }\n // Record that the node needs to be moved to an exported variable with the given name\n const exportName = nodeRequest.name;\n declarations.push({name: exportName, node, order: DeclarationOrder.BeforeStmt});\n return ts.createIdentifier(exportName);\n }\n let result = node;\n if (shouldVisit(pos, end) && !isLexicalScope(node)) {\n result = ts.visitEachChild(node, visitNode, context);\n }\n return result;\n }\n\n // Get the original node before tsickle\n const {pos, end} = ts.getOriginalNode(node);\n let resultStmt: ts.Statement;\n if (shouldVisit(pos, end)) {\n resultStmt = ts.visitEachChild(node, visitNode, context);\n } else {\n resultStmt = node;\n }\n\n if (declarations.length) {\n inserts.push({relativeTo: resultStmt, declarations});\n }\n return resultStmt;\n }\n\n let newStatements = sourceFile.statements.map(topLevelStatement);\n\n if (inserts.length) {\n // Insert the declarations relative to the rewritten statement that references them.\n const insertMap = toMap(inserts, i => i.relativeTo);\n const tmpStatements: ts.Statement[] = [];\n newStatements.forEach(statement => {\n const insert = insertMap.get(statement);\n if (insert) {\n const before = insert.declarations.filter(d => d.order === DeclarationOrder.BeforeStmt);\n if (before.length) {\n tmpStatements.push(createVariableStatementForDeclarations(before));\n }\n tmpStatements.push(statement);\n const after = insert.declarations.filter(d => d.order === DeclarationOrder.AfterStmt);\n if (after.length) {\n tmpStatements.push(createVariableStatementForDeclarations(after));\n }\n } else {\n tmpStatements.push(statement);\n }\n });\n\n // Insert an exports clause to export the declarations\n tmpStatements.push(ts.createExportDeclaration(\n /* decorators */ undefined,\n /* modifiers */ undefined,\n ts.createNamedExports(\n inserts\n .reduce(\n (accumulator, insert) => [...accumulator, ...insert.declarations],\n [] as Declaration[])\n .map(\n declaration => ts.createExportSpecifier(\n /* propertyName */ undefined, declaration.name)))));\n\n newStatements = tmpStatements;\n }\n // Note: We cannot use ts.updateSourcefile here as\n // it does not work well with decorators.\n // See https://github.com/Microsoft/TypeScript/issues/17384\n const newSf = ts.getMutableClone(sourceFile);\n if (!(sourceFile.flags & ts.NodeFlags.Synthesized)) {\n newSf.flags &= ~ts.NodeFlags.Synthesized;\n }\n newSf.statements = ts.setTextRange(ts.createNodeArray(newStatements), sourceFile.statements);\n return newSf;\n }\n\n return visitSourceFile(sourceFile);\n}\n\nfunction createVariableStatementForDeclarations(declarations: Declaration[]): ts.VariableStatement {\n const varDecls = declarations.map(\n i => ts.createVariableDeclaration(i.name, /* type */ undefined, i.node as ts.Expression));\n return ts.createVariableStatement(\n /* modifiers */ undefined, ts.createVariableDeclarationList(varDecls, ts.NodeFlags.Const));\n}\n\nexport function getExpressionLoweringTransformFactory(\n requestsMap: RequestsMap, program: ts.Program): (context: ts.TransformationContext) =>\n (sourceFile: ts.SourceFile) => ts.SourceFile {\n // Return the factory\n return (context: ts.TransformationContext) => (sourceFile: ts.SourceFile): ts.SourceFile => {\n // We need to use the original SourceFile for reading metadata, and not the transformed one.\n const requests = requestsMap.getRequests(program.getSourceFile(sourceFile.fileName));\n if (requests && requests.size) {\n return transformSourceFile(sourceFile, requests, context);\n }\n return sourceFile;\n };\n}\n\nexport interface RequestsMap { getRequests(sourceFile: ts.SourceFile): RequestLocationMap; }\n\ninterface MetadataAndLoweringRequests {\n metadata: ModuleMetadata|undefined;\n requests: RequestLocationMap;\n}\n\nfunction shouldLower(node: ts.Node | undefined): boolean {\n if (node) {\n switch (node.kind) {\n case ts.SyntaxKind.SourceFile:\n case ts.SyntaxKind.Decorator:\n // Lower expressions that are local to the module scope or\n // in a decorator.\n return true;\n case ts.SyntaxKind.ClassDeclaration:\n case ts.SyntaxKind.InterfaceDeclaration:\n case ts.SyntaxKind.EnumDeclaration:\n case ts.SyntaxKind.FunctionDeclaration:\n // Don't lower expressions in a declaration.\n return false;\n case ts.SyntaxKind.VariableDeclaration:\n // Avoid lowering expressions already in an exported variable declaration\n return (ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) == 0;\n }\n return shouldLower(node.parent);\n }\n return true;\n}\n\nfunction isPrimitive(value: any): boolean {\n return Object(value) !== value;\n}\n\nfunction isRewritten(value: any): boolean {\n return isMetadataGlobalReferenceExpression(value) && isLoweredSymbol(value.name);\n}\n\nfunction isLiteralFieldNamed(node: ts.Node, names: Set<string>): boolean {\n if (node.parent && node.parent.kind == ts.SyntaxKind.PropertyAssignment) {\n const property = node.parent as ts.PropertyAssignment;\n if (property.parent && property.parent.kind == ts.SyntaxKind.ObjectLiteralExpression &&\n property.name && property.name.kind == ts.SyntaxKind.Identifier) {\n const propertyName = property.name as ts.Identifier;\n return names.has(propertyName.text);\n }\n }\n return false;\n}\n\nconst LOWERABLE_FIELD_NAMES = new Set(['useValue', 'useFactory', 'data']);\n\nexport class LowerMetadataCache implements RequestsMap {\n private collector: MetadataCollector;\n private metadataCache = new Map<string, MetadataAndLoweringRequests>();\n\n constructor(options: CollectorOptions, private strict?: boolean) {\n this.collector = new MetadataCollector(options);\n }\n\n getMetadata(sourceFile: ts.SourceFile): ModuleMetadata|undefined {\n return this.ensureMetadataAndRequests(sourceFile).metadata;\n }\n\n getRequests(sourceFile: ts.SourceFile): RequestLocationMap {\n return this.ensureMetadataAndRequests(sourceFile).requests;\n }\n\n private ensureMetadataAndRequests(sourceFile: ts.SourceFile): MetadataAndLoweringRequests {\n let result = this.metadataCache.get(sourceFile.fileName);\n if (!result) {\n result = this.getMetadataAndRequests(sourceFile);\n this.metadataCache.set(sourceFile.fileName, result);\n }\n return result;\n }\n\n private getMetadataAndRequests(sourceFile: ts.SourceFile): MetadataAndLoweringRequests {\n let identNumber = 0;\n const freshIdent = () => createLoweredSymbol(identNumber++);\n const requests = new Map<number, LoweringRequest>();\n\n const isExportedSymbol = (() => {\n let exportTable: Set<string>;\n return (node: ts.Node) => {\n if (node.kind == ts.SyntaxKind.Identifier) {\n const ident = node as ts.Identifier;\n\n if (!exportTable) {\n exportTable = createExportTableFor(sourceFile);\n }\n return exportTable.has(ident.text);\n }\n return false;\n };\n })();\n\n const isExportedPropertyAccess = (node: ts.Node) => {\n if (node.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const pae = node as ts.PropertyAccessExpression;\n if (isExportedSymbol(pae.expression)) {\n return true;\n }\n }\n return false;\n };\n const replaceNode = (node: ts.Node) => {\n const name = freshIdent();\n requests.set(node.pos, {name, kind: node.kind, location: node.pos, end: node.end});\n return {__symbolic: 'reference', name};\n };\n\n const substituteExpression = (value: MetadataValue, node: ts.Node): MetadataValue => {\n if (!isPrimitive(value) && !isRewritten(value)) {\n if ((node.kind === ts.SyntaxKind.ArrowFunction ||\n node.kind === ts.SyntaxKind.FunctionExpression) &&\n shouldLower(node)) {\n return replaceNode(node);\n }\n if (isLiteralFieldNamed(node, LOWERABLE_FIELD_NAMES) && shouldLower(node) &&\n !isExportedSymbol(node) && !isExportedPropertyAccess(node)) {\n return replaceNode(node);\n }\n }\n return value;\n };\n\n // Do not validate or lower metadata in a declaration file. Declaration files are requested\n // when we need to update the version of the metadata to add informatoin that might be missing\n // in the out-of-date version that can be recovered from the .d.ts file.\n const declarationFile = sourceFile.isDeclarationFile;\n\n const metadata = this.collector.getMetadata(\n sourceFile, this.strict && !declarationFile,\n declarationFile ? undefined : substituteExpression);\n\n return {metadata, requests};\n }\n}\n\nfunction createExportTableFor(sourceFile: ts.SourceFile): Set<string> {\n const exportTable = new Set<string>();\n // Lazily collect all the exports from the source file\n ts.forEachChild(sourceFile, function scan(node) {\n switch (node.kind) {\n case ts.SyntaxKind.ClassDeclaration:\n case ts.SyntaxKind.FunctionDeclaration:\n case ts.SyntaxKind.InterfaceDeclaration:\n if ((ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) != 0) {\n const classDeclaration =\n node as(ts.ClassDeclaration | ts.FunctionDeclaration | ts.InterfaceDeclaration);\n const name = classDeclaration.name;\n if (name) exportTable.add(name.text);\n }\n break;\n case ts.SyntaxKind.VariableStatement:\n const variableStatement = node as ts.VariableStatement;\n for (const declaration of variableStatement.declarationList.declarations) {\n scan(declaration);\n }\n break;\n case ts.SyntaxKind.VariableDeclaration:\n const variableDeclaration = node as ts.VariableDeclaration;\n if ((ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) != 0 &&\n variableDeclaration.name.kind == ts.SyntaxKind.Identifier) {\n const name = variableDeclaration.name as ts.Identifier;\n exportTable.add(name.text);\n }\n break;\n case ts.SyntaxKind.ExportDeclaration:\n const exportDeclaration = node as ts.ExportDeclaration;\n const {moduleSpecifier, exportClause} = exportDeclaration;\n if (!moduleSpecifier && exportClause) {\n exportClause.elements.forEach(spec => { exportTable.add(spec.name.text); });\n }\n }\n });\n return exportTable;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"lower_expressions.js","sourceRoot":"","sources":["../../../../../packages/compiler-cli/src/transformers/lower_expressions.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,8CAAuE;AACvE,+BAAiC;AAEjC,2CAA0I;AAwB1I,eAAqB,KAAU,EAAE,MAAsB;IACrD,MAAM,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAS,UAAA,CAAC,IAAI,OAAA,CAA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ACH,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,WAAW,CAAC;AACrB,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {createLoweredSymbol, isLoweredSymbol} from '@angular/compiler';\nimport * as ts from 'typescript';\n\nimport {CollectorOptions, MetadataCollector, MetadataValue, ModuleMetadata, isMetadataGlobalReferenceExpression} from '../metadata/index';\n\nexport interface LoweringRequest {\n kind: ts.SyntaxKind;\n location: number;\n end: number;\n name: string;\n}\n\nexport type RequestLocationMap = Map<number, LoweringRequest>;\n\nconst enum DeclarationOrder { BeforeStmt, AfterStmt }\n\ninterface Declaration {\n name: string;\n node: ts.Node;\n order: DeclarationOrder;\n}\n\ninterface DeclarationInsert {\n declarations: Declaration[];\n relativeTo: ts.Node;\n}\n\nfunction toMap<T, K>(items: T[], select: (item: T) => K): Map<K, T> {\n return new Map(items.map<[K, T]>(i => [select(i), i]));\n}\n\n// We will never lower expressions in a nested lexical scope so avoid entering them.\n// This also avoids a bug in TypeScript 2.3 where the lexical scopes get out of sync\n// when using visitEachChild.\nfunction isLexicalScope(node: ts.Node): boolean {\n switch (node.kind) {\n case ts.SyntaxKind.ArrowFunction:\n case ts.SyntaxKind.FunctionExpression:\n case ts.SyntaxKind.FunctionDeclaration:\n case ts.SyntaxKind.ClassExpression:\n case ts.SyntaxKind.ClassDeclaration:\n case ts.SyntaxKind.FunctionType:\n case ts.SyntaxKind.TypeLiteral:\n case ts.SyntaxKind.ArrayType:\n return true;\n }\n return false;\n}\n\nfunction transformSourceFile(\n sourceFile: ts.SourceFile, requests: RequestLocationMap,\n context: ts.TransformationContext): ts.SourceFile {\n const inserts: DeclarationInsert[] = [];\n\n // Calculate the range of interesting locations. The transform will only visit nodes in this\n // range to improve the performance on large files.\n const locations = Array.from(requests.keys());\n const min = Math.min(...locations);\n const max = Math.max(...locations);\n\n // Visit nodes matching the request and synthetic nodes added by tsickle\n function shouldVisit(pos: number, end: number): boolean {\n return (pos <= max && end >= min) || pos == -1;\n }\n\n function visitSourceFile(sourceFile: ts.SourceFile): ts.SourceFile {\n function topLevelStatement(node: ts.Statement): ts.Statement {\n const declarations: Declaration[] = [];\n\n function visitNode(node: ts.Node): ts.Node {\n // Get the original node before tsickle\n const {pos, end, kind, parent: originalParent} = ts.getOriginalNode(node);\n const nodeRequest = requests.get(pos);\n if (nodeRequest && nodeRequest.kind == kind && nodeRequest.end == end) {\n // This node is requested to be rewritten as a reference to the exported name.\n if (originalParent && originalParent.kind === ts.SyntaxKind.VariableDeclaration) {\n // As the value represents the whole initializer of a variable declaration,\n // just refer to that variable. This e.g. helps to preserve closure comments\n // at the right place.\n const varParent = originalParent as ts.VariableDeclaration;\n if (varParent.name.kind === ts.SyntaxKind.Identifier) {\n const varName = varParent.name.text;\n const exportName = nodeRequest.name;\n declarations.push({\n name: exportName,\n node: ts.createIdentifier(varName),\n order: DeclarationOrder.AfterStmt\n });\n return node;\n }\n }\n // Record that the node needs to be moved to an exported variable with the given name\n const exportName = nodeRequest.name;\n declarations.push({name: exportName, node, order: DeclarationOrder.BeforeStmt});\n return ts.createIdentifier(exportName);\n }\n let result = node;\n if (shouldVisit(pos, end) && !isLexicalScope(node)) {\n result = ts.visitEachChild(node, visitNode, context);\n }\n return result;\n }\n\n // Get the original node before tsickle\n const {pos, end} = ts.getOriginalNode(node);\n let resultStmt: ts.Statement;\n if (shouldVisit(pos, end)) {\n resultStmt = ts.visitEachChild(node, visitNode, context);\n } else {\n resultStmt = node;\n }\n\n if (declarations.length) {\n inserts.push({relativeTo: resultStmt, declarations});\n }\n return resultStmt;\n }\n\n let newStatements = sourceFile.statements.map(topLevelStatement);\n\n if (inserts.length) {\n // Insert the declarations relative to the rewritten statement that references them.\n const insertMap = toMap(inserts, i => i.relativeTo);\n const tmpStatements: ts.Statement[] = [];\n newStatements.forEach(statement => {\n const insert = insertMap.get(statement);\n if (insert) {\n const before = insert.declarations.filter(d => d.order === DeclarationOrder.BeforeStmt);\n if (before.length) {\n tmpStatements.push(createVariableStatementForDeclarations(before));\n }\n tmpStatements.push(statement);\n const after = insert.declarations.filter(d => d.order === DeclarationOrder.AfterStmt);\n if (after.length) {\n tmpStatements.push(createVariableStatementForDeclarations(after));\n }\n } else {\n tmpStatements.push(statement);\n }\n });\n\n // Insert an exports clause to export the declarations\n tmpStatements.push(ts.createExportDeclaration(\n /* decorators */ undefined,\n /* modifiers */ undefined,\n ts.createNamedExports(\n inserts\n .reduce(\n (accumulator, insert) => [...accumulator, ...insert.declarations],\n [] as Declaration[])\n .map(\n declaration => ts.createExportSpecifier(\n /* propertyName */ undefined, declaration.name)))));\n\n newStatements = tmpStatements;\n }\n // Note: We cannot use ts.updateSourcefile here as\n // it does not work well with decorators.\n // See https://github.com/Microsoft/TypeScript/issues/17384\n const newSf = ts.getMutableClone(sourceFile);\n if (!(sourceFile.flags & ts.NodeFlags.Synthesized)) {\n newSf.flags &= ~ts.NodeFlags.Synthesized;\n }\n newSf.statements = ts.setTextRange(ts.createNodeArray(newStatements), sourceFile.statements);\n return newSf;\n }\n\n return visitSourceFile(sourceFile);\n}\n\nfunction createVariableStatementForDeclarations(declarations: Declaration[]): ts.VariableStatement {\n const varDecls = declarations.map(\n i => ts.createVariableDeclaration(i.name, /* type */ undefined, i.node as ts.Expression));\n return ts.createVariableStatement(\n /* modifiers */ undefined, ts.createVariableDeclarationList(varDecls, ts.NodeFlags.Const));\n}\n\nexport function getExpressionLoweringTransformFactory(\n requestsMap: RequestsMap, program: ts.Program): (context: ts.TransformationContext) =>\n (sourceFile: ts.SourceFile) => ts.SourceFile {\n // Return the factory\n return (context: ts.TransformationContext) => (sourceFile: ts.SourceFile): ts.SourceFile => {\n // We need to use the original SourceFile for reading metadata, and not the transformed one.\n const requests = requestsMap.getRequests(program.getSourceFile(sourceFile.fileName));\n if (requests && requests.size) {\n return transformSourceFile(sourceFile, requests, context);\n }\n return sourceFile;\n };\n}\n\nexport interface RequestsMap { getRequests(sourceFile: ts.SourceFile): RequestLocationMap; }\n\ninterface MetadataAndLoweringRequests {\n metadata: ModuleMetadata|undefined;\n requests: RequestLocationMap;\n}\n\nfunction shouldLower(node: ts.Node | undefined): boolean {\n if (node) {\n switch (node.kind) {\n case ts.SyntaxKind.SourceFile:\n case ts.SyntaxKind.Decorator:\n // Lower expressions that are local to the module scope or\n // in a decorator.\n return true;\n case ts.SyntaxKind.ClassDeclaration:\n case ts.SyntaxKind.InterfaceDeclaration:\n case ts.SyntaxKind.EnumDeclaration:\n case ts.SyntaxKind.FunctionDeclaration:\n // Don't lower expressions in a declaration.\n return false;\n case ts.SyntaxKind.VariableDeclaration:\n // Avoid lowering expressions already in an exported variable declaration\n return (ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) == 0;\n }\n return shouldLower(node.parent);\n }\n return true;\n}\n\nfunction isPrimitive(value: any): boolean {\n return Object(value) !== value;\n}\n\nfunction isRewritten(value: any): boolean {\n return isMetadataGlobalReferenceExpression(value) && isLoweredSymbol(value.name);\n}\n\nfunction isLiteralFieldNamed(node: ts.Node, names: Set<string>): boolean {\n if (node.parent && node.parent.kind == ts.SyntaxKind.PropertyAssignment) {\n const property = node.parent as ts.PropertyAssignment;\n if (property.parent && property.parent.kind == ts.SyntaxKind.ObjectLiteralExpression &&\n property.name && property.name.kind == ts.SyntaxKind.Identifier) {\n const propertyName = property.name as ts.Identifier;\n return names.has(propertyName.text);\n }\n }\n return false;\n}\n\nconst LOWERABLE_FIELD_NAMES = new Set(['useValue', 'useFactory', 'data']);\n\nexport class LowerMetadataCache implements RequestsMap {\n private collector: MetadataCollector;\n private metadataCache = new Map<string, MetadataAndLoweringRequests>();\n\n constructor(options: CollectorOptions, private strict?: boolean) {\n this.collector = new MetadataCollector(options);\n }\n\n getMetadata(sourceFile: ts.SourceFile): ModuleMetadata|undefined {\n return this.ensureMetadataAndRequests(sourceFile).metadata;\n }\n\n getRequests(sourceFile: ts.SourceFile): RequestLocationMap {\n return this.ensureMetadataAndRequests(sourceFile).requests;\n }\n\n private ensureMetadataAndRequests(sourceFile: ts.SourceFile): MetadataAndLoweringRequests {\n let result = this.metadataCache.get(sourceFile.fileName);\n if (!result) {\n result = this.getMetadataAndRequests(sourceFile);\n this.metadataCache.set(sourceFile.fileName, result);\n }\n return result;\n }\n\n private getMetadataAndRequests(sourceFile: ts.SourceFile): MetadataAndLoweringRequests {\n let identNumber = 0;\n const freshIdent = () => createLoweredSymbol(identNumber++);\n const requests = new Map<number, LoweringRequest>();\n\n const isExportedSymbol = (() => {\n let exportTable: Set<string>;\n return (node: ts.Node) => {\n if (node.kind == ts.SyntaxKind.Identifier) {\n const ident = node as ts.Identifier;\n\n if (!exportTable) {\n exportTable = createExportTableFor(sourceFile);\n }\n return exportTable.has(ident.text);\n }\n return false;\n };\n })();\n\n const isExportedPropertyAccess = (node: ts.Node) => {\n if (node.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const pae = node as ts.PropertyAccessExpression;\n if (isExportedSymbol(pae.expression)) {\n return true;\n }\n }\n return false;\n };\n const replaceNode = (node: ts.Node) => {\n const name = freshIdent();\n requests.set(node.pos, {name, kind: node.kind, location: node.pos, end: node.end});\n return {__symbolic: 'reference', name};\n };\n\n const substituteExpression = (value: MetadataValue, node: ts.Node): MetadataValue => {\n if (!isPrimitive(value) && !isRewritten(value)) {\n if ((node.kind === ts.SyntaxKind.ArrowFunction ||\n node.kind === ts.SyntaxKind.FunctionExpression) &&\n shouldLower(node)) {\n return replaceNode(node);\n }\n if (isLiteralFieldNamed(node, LOWERABLE_FIELD_NAMES) && shouldLower(node) &&\n !isExportedSymbol(node) && !isExportedPropertyAccess(node)) {\n return replaceNode(node);\n }\n }\n return value;\n };\n\n // Do not validate or lower metadata in a declaration file. Declaration files are requested\n // when we need to update the version of the metadata to add information that might be missing\n // in the out-of-date version that can be recovered from the .d.ts file.\n const declarationFile = sourceFile.isDeclarationFile;\n const moduleFile = ts.isExternalModule(sourceFile);\n\n const metadata = this.collector.getMetadata(\n sourceFile, this.strict && !declarationFile,\n moduleFile && !declarationFile ? substituteExpression : undefined);\n\n return {metadata, requests};\n }\n}\n\nfunction createExportTableFor(sourceFile: ts.SourceFile): Set<string> {\n const exportTable = new Set<string>();\n // Lazily collect all the exports from the source file\n ts.forEachChild(sourceFile, function scan(node) {\n switch (node.kind) {\n case ts.SyntaxKind.ClassDeclaration:\n case ts.SyntaxKind.FunctionDeclaration:\n case ts.SyntaxKind.InterfaceDeclaration:\n if ((ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) != 0) {\n const classDeclaration =\n node as(ts.ClassDeclaration | ts.FunctionDeclaration | ts.InterfaceDeclaration);\n const name = classDeclaration.name;\n if (name) exportTable.add(name.text);\n }\n break;\n case ts.SyntaxKind.VariableStatement:\n const variableStatement = node as ts.VariableStatement;\n for (const declaration of variableStatement.declarationList.declarations) {\n scan(declaration);\n }\n break;\n case ts.SyntaxKind.VariableDeclaration:\n const variableDeclaration = node as ts.VariableDeclaration;\n if ((ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) != 0 &&\n variableDeclaration.name.kind == ts.SyntaxKind.Identifier) {\n const name = variableDeclaration.name as ts.Identifier;\n exportTable.add(name.text);\n }\n break;\n case ts.SyntaxKind.ExportDeclaration:\n const exportDeclaration = node as ts.ExportDeclaration;\n const {moduleSpecifier, exportClause} = exportDeclaration;\n if (!moduleSpecifier && exportClause) {\n exportClause.elements.forEach(spec => { exportTable.add(spec.name.text); });\n }\n }\n });\n return exportTable;\n}\n"]}
|
package/src/version.js
CHANGED
package/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../packages/compiler-cli/src/version.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH;;;;GAIG;AAEH,8CAA0C;AAC1C;;GAEG;AACU,QAAA,OAAO,GAAG,IAAI,kBAAO,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n\nimport {Version} from '@angular/compiler';\n/**\n * @stable\n */\nexport const VERSION = new Version('5.2.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../packages/compiler-cli/src/version.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH;;;;GAIG;AAEH,8CAA0C;AAC1C;;GAEG;AACU,QAAA,OAAO,GAAG,IAAI,kBAAO,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n\nimport {Version} from '@angular/compiler';\n/**\n * @stable\n */\nexport const VERSION = new Version('5.2.3');\n"]}
|