source: trip-planner-front/node_modules/@angular/compiler-cli/src/transformers/node_emitter.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 113.3 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8(function (factory) {
9 if (typeof module === "object" && typeof module.exports === "object") {
10 var v = factory(require, exports);
11 if (v !== undefined) module.exports = v;
12 }
13 else if (typeof define === "function" && define.amd) {
14 define("@angular/compiler-cli/src/transformers/node_emitter", ["require", "exports", "tslib", "@angular/compiler", "typescript", "@angular/compiler-cli/src/ngtsc/translator", "@angular/compiler-cli/src/transformers/util"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.NodeEmitterVisitor = exports.updateSourceFile = exports.TypeScriptNodeEmitter = void 0;
20 var tslib_1 = require("tslib");
21 var compiler_1 = require("@angular/compiler");
22 var ts = require("typescript");
23 var translator_1 = require("@angular/compiler-cli/src/ngtsc/translator");
24 var util_1 = require("@angular/compiler-cli/src/transformers/util");
25 var METHOD_THIS_NAME = 'this';
26 var CATCH_ERROR_NAME = 'error';
27 var CATCH_STACK_NAME = 'stack';
28 var _VALID_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
29 var TypeScriptNodeEmitter = /** @class */ (function () {
30 function TypeScriptNodeEmitter(annotateForClosureCompiler) {
31 this.annotateForClosureCompiler = annotateForClosureCompiler;
32 }
33 TypeScriptNodeEmitter.prototype.updateSourceFile = function (sourceFile, stmts, preamble) {
34 var converter = new NodeEmitterVisitor(this.annotateForClosureCompiler);
35 // [].concat flattens the result so that each `visit...` method can also return an array of
36 // stmts.
37 var statements = [].concat.apply([], tslib_1.__spreadArray([], tslib_1.__read(stmts.map(function (stmt) { return stmt.visitStatement(converter, null); }).filter(function (stmt) { return stmt != null; }))));
38 var sourceStatements = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(converter.getReexports())), tslib_1.__read(converter.getImports())), tslib_1.__read(statements));
39 if (preamble) {
40 // We always attach the preamble comment to a `NotEmittedStatement` node, because tsickle uses
41 // this node type as a marker of the preamble to ensure that it adds its own new nodes after
42 // the preamble.
43 var preambleCommentHolder = ts.createNotEmittedStatement(sourceFile);
44 // Preamble comments are passed through as-is, which means that they must already contain a
45 // leading `*` if they should be a JSDOC comment.
46 ts.addSyntheticLeadingComment(preambleCommentHolder, ts.SyntaxKind.MultiLineCommentTrivia, preamble,
47 /* hasTrailingNewline */ true);
48 sourceStatements.unshift(preambleCommentHolder);
49 }
50 converter.updateSourceMap(sourceStatements);
51 var newSourceFile = ts.updateSourceFileNode(sourceFile, sourceStatements);
52 return [newSourceFile, converter.getNodeMap()];
53 };
54 return TypeScriptNodeEmitter;
55 }());
56 exports.TypeScriptNodeEmitter = TypeScriptNodeEmitter;
57 /**
58 * Update the given source file to include the changes specified in module.
59 *
60 * The module parameter is treated as a partial module meaning that the statements are added to
61 * the module instead of replacing the module. Also, any classes are treated as partial classes
62 * and the included members are added to the class with the same name instead of a new class
63 * being created.
64 */
65 function updateSourceFile(sourceFile, module, annotateForClosureCompiler) {
66 var converter = new NodeEmitterVisitor(annotateForClosureCompiler);
67 converter.loadExportedVariableIdentifiers(sourceFile);
68 var prefixStatements = module.statements.filter(function (statement) { return !(statement instanceof compiler_1.ClassStmt); });
69 var classes = module.statements.filter(function (statement) { return statement instanceof compiler_1.ClassStmt; });
70 var classMap = new Map(classes.map(function (classStatement) { return [classStatement.name, classStatement]; }));
71 var classNames = new Set(classes.map(function (classStatement) { return classStatement.name; }));
72 var prefix = prefixStatements.map(function (statement) { return statement.visitStatement(converter, sourceFile); });
73 // Add static methods to all the classes referenced in module.
74 var newStatements = sourceFile.statements.map(function (node) {
75 if (node.kind == ts.SyntaxKind.ClassDeclaration) {
76 var classDeclaration = node;
77 var name = classDeclaration.name;
78 if (name) {
79 var classStatement = classMap.get(name.text);
80 if (classStatement) {
81 classNames.delete(name.text);
82 var classMemberHolder = converter.visitDeclareClassStmt(classStatement);
83 var newMethods = classMemberHolder.members.filter(function (member) { return member.kind !== ts.SyntaxKind.Constructor; });
84 var newMembers = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(classDeclaration.members)), tslib_1.__read(newMethods));
85 return ts.updateClassDeclaration(classDeclaration,
86 /* decorators */ classDeclaration.decorators,
87 /* modifiers */ classDeclaration.modifiers,
88 /* name */ classDeclaration.name,
89 /* typeParameters */ classDeclaration.typeParameters,
90 /* heritageClauses */ classDeclaration.heritageClauses || [],
91 /* members */ newMembers);
92 }
93 }
94 }
95 return node;
96 });
97 // Validate that all the classes have been generated
98 classNames.size == 0 ||
99 util_1.error((classNames.size == 1 ? 'Class' : 'Classes') + " \"" + Array.from(classNames.keys()).join(', ') + "\" not generated");
100 // Add imports to the module required by the new methods
101 var imports = converter.getImports();
102 if (imports && imports.length) {
103 // Find where the new imports should go
104 var index = firstAfter(newStatements, function (statement) { return statement.kind === ts.SyntaxKind.ImportDeclaration ||
105 statement.kind === ts.SyntaxKind.ImportEqualsDeclaration; });
106 newStatements = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(newStatements.slice(0, index))), tslib_1.__read(imports)), tslib_1.__read(prefix)), tslib_1.__read(newStatements.slice(index)));
107 }
108 else {
109 newStatements = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(prefix)), tslib_1.__read(newStatements));
110 }
111 converter.updateSourceMap(newStatements);
112 var newSourceFile = ts.updateSourceFileNode(sourceFile, newStatements);
113 return [newSourceFile, converter.getNodeMap()];
114 }
115 exports.updateSourceFile = updateSourceFile;
116 // Return the index after the first value in `a` that doesn't match the predicate after a value that
117 // does or 0 if no values match.
118 function firstAfter(a, predicate) {
119 var index = 0;
120 var len = a.length;
121 for (; index < len; index++) {
122 var value = a[index];
123 if (predicate(value))
124 break;
125 }
126 if (index >= len)
127 return 0;
128 for (; index < len; index++) {
129 var value = a[index];
130 if (!predicate(value))
131 break;
132 }
133 return index;
134 }
135 function escapeLiteral(value) {
136 return value.replace(/(\"|\\)/g, '\\$1').replace(/(\n)|(\r)/g, function (v, n, r) {
137 return n ? '\\n' : '\\r';
138 });
139 }
140 function createLiteral(value) {
141 if (value === null) {
142 return ts.createNull();
143 }
144 else if (value === undefined) {
145 return ts.createIdentifier('undefined');
146 }
147 else {
148 var result = ts.createLiteral(value);
149 if (ts.isStringLiteral(result) && result.text.indexOf('\\') >= 0) {
150 // Hack to avoid problems cause indirectly by:
151 // https://github.com/Microsoft/TypeScript/issues/20192
152 // This avoids the string escaping normally performed for a string relying on that
153 // TypeScript just emits the text raw for a numeric literal.
154 result.kind = ts.SyntaxKind.NumericLiteral;
155 result.text = "\"" + escapeLiteral(result.text) + "\"";
156 }
157 return result;
158 }
159 }
160 function isExportTypeStatement(statement) {
161 return !!statement.modifiers &&
162 statement.modifiers.some(function (mod) { return mod.kind === ts.SyntaxKind.ExportKeyword; });
163 }
164 /**
165 * Visits an output ast and produces the corresponding TypeScript synthetic nodes.
166 */
167 var NodeEmitterVisitor = /** @class */ (function () {
168 function NodeEmitterVisitor(annotateForClosureCompiler) {
169 this.annotateForClosureCompiler = annotateForClosureCompiler;
170 this._nodeMap = new Map();
171 this._importsWithPrefixes = new Map();
172 this._reexports = new Map();
173 this._templateSources = new Map();
174 this._exportedVariableIdentifiers = new Map();
175 }
176 /**
177 * Process the source file and collect exported identifiers that refer to variables.
178 *
179 * Only variables are collected because exported classes still exist in the module scope in
180 * CommonJS, whereas variables have their declarations moved onto the `exports` object, and all
181 * references are updated accordingly.
182 */
183 NodeEmitterVisitor.prototype.loadExportedVariableIdentifiers = function (sourceFile) {
184 var _this = this;
185 sourceFile.statements.forEach(function (statement) {
186 if (ts.isVariableStatement(statement) && isExportTypeStatement(statement)) {
187 statement.declarationList.declarations.forEach(function (declaration) {
188 if (ts.isIdentifier(declaration.name)) {
189 _this._exportedVariableIdentifiers.set(declaration.name.text, declaration.name);
190 }
191 });
192 }
193 });
194 };
195 NodeEmitterVisitor.prototype.getReexports = function () {
196 return Array.from(this._reexports.entries())
197 .map(function (_a) {
198 var _b = tslib_1.__read(_a, 2), exportedFilePath = _b[0], reexports = _b[1];
199 return ts.createExportDeclaration(
200 /* decorators */ undefined,
201 /* modifiers */ undefined, ts.createNamedExports(reexports.map(function (_a) {
202 var name = _a.name, as = _a.as;
203 return ts.createExportSpecifier(name, as);
204 })),
205 /* moduleSpecifier */ createLiteral(exportedFilePath));
206 });
207 };
208 NodeEmitterVisitor.prototype.getImports = function () {
209 return Array.from(this._importsWithPrefixes.entries())
210 .map(function (_a) {
211 var _b = tslib_1.__read(_a, 2), namespace = _b[0], prefix = _b[1];
212 return ts.createImportDeclaration(
213 /* decorators */ undefined,
214 /* modifiers */ undefined,
215 /* importClause */
216 ts.createImportClause(
217 /* name */ undefined, ts.createNamespaceImport(ts.createIdentifier(prefix))),
218 /* moduleSpecifier */ createLiteral(namespace));
219 });
220 };
221 NodeEmitterVisitor.prototype.getNodeMap = function () {
222 return this._nodeMap;
223 };
224 NodeEmitterVisitor.prototype.updateSourceMap = function (statements) {
225 var _this = this;
226 var lastRangeStartNode = undefined;
227 var lastRangeEndNode = undefined;
228 var lastRange = undefined;
229 var recordLastSourceRange = function () {
230 if (lastRange && lastRangeStartNode && lastRangeEndNode) {
231 if (lastRangeStartNode == lastRangeEndNode) {
232 ts.setSourceMapRange(lastRangeEndNode, lastRange);
233 }
234 else {
235 ts.setSourceMapRange(lastRangeStartNode, lastRange);
236 // Only emit the pos for the first node emitted in the range.
237 ts.setEmitFlags(lastRangeStartNode, ts.EmitFlags.NoTrailingSourceMap);
238 ts.setSourceMapRange(lastRangeEndNode, lastRange);
239 // Only emit emit end for the last node emitted in the range.
240 ts.setEmitFlags(lastRangeEndNode, ts.EmitFlags.NoLeadingSourceMap);
241 }
242 }
243 };
244 var visitNode = function (tsNode) {
245 var ngNode = _this._nodeMap.get(tsNode);
246 if (ngNode) {
247 var range = _this.sourceRangeOf(ngNode);
248 if (range) {
249 if (!lastRange || range.source != lastRange.source || range.pos != lastRange.pos ||
250 range.end != lastRange.end) {
251 recordLastSourceRange();
252 lastRangeStartNode = tsNode;
253 lastRange = range;
254 }
255 lastRangeEndNode = tsNode;
256 }
257 }
258 ts.forEachChild(tsNode, visitNode);
259 };
260 statements.forEach(visitNode);
261 recordLastSourceRange();
262 };
263 NodeEmitterVisitor.prototype.postProcess = function (ngNode, tsNode) {
264 if (tsNode && !this._nodeMap.has(tsNode)) {
265 this._nodeMap.set(tsNode, ngNode);
266 }
267 if (tsNode !== null && ngNode instanceof compiler_1.Statement && ngNode.leadingComments !== undefined) {
268 translator_1.attachComments(tsNode, ngNode.leadingComments);
269 }
270 return tsNode;
271 };
272 NodeEmitterVisitor.prototype.sourceRangeOf = function (node) {
273 if (node.sourceSpan) {
274 var span = node.sourceSpan;
275 if (span.start.file == span.end.file) {
276 var file = span.start.file;
277 if (file.url) {
278 var source = this._templateSources.get(file);
279 if (!source) {
280 source = ts.createSourceMapSource(file.url, file.content, function (pos) { return pos; });
281 this._templateSources.set(file, source);
282 }
283 return { pos: span.start.offset, end: span.end.offset, source: source };
284 }
285 }
286 }
287 return null;
288 };
289 NodeEmitterVisitor.prototype.getModifiers = function (stmt) {
290 var modifiers = [];
291 if (stmt.hasModifier(compiler_1.StmtModifier.Exported)) {
292 modifiers.push(ts.createToken(ts.SyntaxKind.ExportKeyword));
293 }
294 return modifiers;
295 };
296 // StatementVisitor
297 NodeEmitterVisitor.prototype.visitDeclareVarStmt = function (stmt) {
298 if (stmt.hasModifier(compiler_1.StmtModifier.Exported) && stmt.value instanceof compiler_1.ExternalExpr &&
299 !stmt.type) {
300 // check for a reexport
301 var _a = stmt.value.value, name = _a.name, moduleName = _a.moduleName;
302 if (moduleName) {
303 var reexports = this._reexports.get(moduleName);
304 if (!reexports) {
305 reexports = [];
306 this._reexports.set(moduleName, reexports);
307 }
308 reexports.push({ name: name, as: stmt.name });
309 return null;
310 }
311 }
312 var varDeclList = ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.createIdentifier(stmt.name),
313 /* type */ undefined, (stmt.value && stmt.value.visitExpression(this, null)) || undefined)]);
314 if (stmt.hasModifier(compiler_1.StmtModifier.Exported)) {
315 // Note: We need to add an explicit variable and export declaration so that
316 // the variable can be referred in the same file as well.
317 var tsVarStmt = this.postProcess(stmt, ts.createVariableStatement(/* modifiers */ [], varDeclList));
318 var exportStmt = this.postProcess(stmt, ts.createExportDeclaration(
319 /*decorators*/ undefined, /*modifiers*/ undefined, ts.createNamedExports([ts.createExportSpecifier(stmt.name, stmt.name)])));
320 return [tsVarStmt, exportStmt];
321 }
322 return this.postProcess(stmt, ts.createVariableStatement(this.getModifiers(stmt), varDeclList));
323 };
324 NodeEmitterVisitor.prototype.visitDeclareFunctionStmt = function (stmt) {
325 return this.postProcess(stmt, ts.createFunctionDeclaration(
326 /* decorators */ undefined, this.getModifiers(stmt),
327 /* asteriskToken */ undefined, stmt.name, /* typeParameters */ undefined, stmt.params.map(function (p) { return ts.createParameter(
328 /* decorators */ undefined, /* modifiers */ undefined,
329 /* dotDotDotToken */ undefined, p.name); }),
330 /* type */ undefined, this._visitStatements(stmt.statements)));
331 };
332 NodeEmitterVisitor.prototype.visitExpressionStmt = function (stmt) {
333 return this.postProcess(stmt, ts.createStatement(stmt.expr.visitExpression(this, null)));
334 };
335 NodeEmitterVisitor.prototype.visitReturnStmt = function (stmt) {
336 return this.postProcess(stmt, ts.createReturn(stmt.value ? stmt.value.visitExpression(this, null) : undefined));
337 };
338 NodeEmitterVisitor.prototype.visitDeclareClassStmt = function (stmt) {
339 var _this = this;
340 var modifiers = this.getModifiers(stmt);
341 var fields = stmt.fields.map(function (field) {
342 var property = ts.createProperty(
343 /* decorators */ undefined, /* modifiers */ translateModifiers(field.modifiers), field.name,
344 /* questionToken */ undefined,
345 /* type */ undefined, field.initializer == null ? ts.createNull() :
346 field.initializer.visitExpression(_this, null));
347 if (_this.annotateForClosureCompiler) {
348 // Closure compiler transforms the form `Service.ɵprov = X` into `Service$ɵprov = X`. To
349 // prevent this transformation, such assignments need to be annotated with @nocollapse.
350 // Note that tsickle is typically responsible for adding such annotations, however it
351 // doesn't yet handle synthetic fields added during other transformations.
352 ts.addSyntheticLeadingComment(property, ts.SyntaxKind.MultiLineCommentTrivia, '* @nocollapse ',
353 /* hasTrailingNewLine */ false);
354 }
355 return property;
356 });
357 var getters = stmt.getters.map(function (getter) { return ts.createGetAccessor(
358 /* decorators */ undefined, /* modifiers */ undefined, getter.name, /* parameters */ [],
359 /* type */ undefined, _this._visitStatements(getter.body)); });
360 var constructor = (stmt.constructorMethod && [ts.createConstructor(
361 /* decorators */ undefined,
362 /* modifiers */ undefined,
363 /* parameters */
364 stmt.constructorMethod.params.map(function (p) { return ts.createParameter(
365 /* decorators */ undefined,
366 /* modifiers */ undefined,
367 /* dotDotDotToken */ undefined, p.name); }), this._visitStatements(stmt.constructorMethod.body))]) ||
368 [];
369 // TODO {chuckj}: Determine what should be done for a method with a null name.
370 var methods = stmt.methods.filter(function (method) { return method.name; })
371 .map(function (method) { return ts.createMethod(
372 /* decorators */ undefined,
373 /* modifiers */ translateModifiers(method.modifiers),
374 /* astriskToken */ undefined, method.name /* guarded by filter */,
375 /* questionToken */ undefined, /* typeParameters */ undefined, method.params.map(function (p) { return ts.createParameter(
376 /* decorators */ undefined, /* modifiers */ undefined,
377 /* dotDotDotToken */ undefined, p.name); }),
378 /* type */ undefined, _this._visitStatements(method.body)); });
379 return this.postProcess(stmt, ts.createClassDeclaration(
380 /* decorators */ undefined, modifiers, stmt.name, /* typeParameters*/ undefined, stmt.parent &&
381 [ts.createHeritageClause(ts.SyntaxKind.ExtendsKeyword, [stmt.parent.visitExpression(this, null)])] ||
382 [], tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(fields)), tslib_1.__read(getters)), tslib_1.__read(constructor)), tslib_1.__read(methods))));
383 };
384 NodeEmitterVisitor.prototype.visitIfStmt = function (stmt) {
385 return this.postProcess(stmt, ts.createIf(stmt.condition.visitExpression(this, null), this._visitStatements(stmt.trueCase), stmt.falseCase && stmt.falseCase.length && this._visitStatements(stmt.falseCase) ||
386 undefined));
387 };
388 NodeEmitterVisitor.prototype.visitTryCatchStmt = function (stmt) {
389 return this.postProcess(stmt, ts.createTry(this._visitStatements(stmt.bodyStmts), ts.createCatchClause(CATCH_ERROR_NAME, this._visitStatementsPrefix([ts.createVariableStatement(
390 /* modifiers */ undefined, [ts.createVariableDeclaration(CATCH_STACK_NAME, /* type */ undefined, ts.createPropertyAccess(ts.createIdentifier(CATCH_ERROR_NAME), ts.createIdentifier(CATCH_STACK_NAME)))])], stmt.catchStmts)),
391 /* finallyBlock */ undefined));
392 };
393 NodeEmitterVisitor.prototype.visitThrowStmt = function (stmt) {
394 return this.postProcess(stmt, ts.createThrow(stmt.error.visitExpression(this, null)));
395 };
396 // ExpressionVisitor
397 NodeEmitterVisitor.prototype.visitWrappedNodeExpr = function (expr) {
398 return this.postProcess(expr, expr.node);
399 };
400 NodeEmitterVisitor.prototype.visitTypeofExpr = function (expr) {
401 var typeOf = ts.createTypeOf(expr.expr.visitExpression(this, null));
402 return this.postProcess(expr, typeOf);
403 };
404 // ExpressionVisitor
405 NodeEmitterVisitor.prototype.visitReadVarExpr = function (expr) {
406 switch (expr.builtin) {
407 case compiler_1.BuiltinVar.This:
408 return this.postProcess(expr, ts.createIdentifier(METHOD_THIS_NAME));
409 case compiler_1.BuiltinVar.CatchError:
410 return this.postProcess(expr, ts.createIdentifier(CATCH_ERROR_NAME));
411 case compiler_1.BuiltinVar.CatchStack:
412 return this.postProcess(expr, ts.createIdentifier(CATCH_STACK_NAME));
413 case compiler_1.BuiltinVar.Super:
414 return this.postProcess(expr, ts.createSuper());
415 }
416 if (expr.name) {
417 return this.postProcess(expr, ts.createIdentifier(expr.name));
418 }
419 throw Error("Unexpected ReadVarExpr form");
420 };
421 NodeEmitterVisitor.prototype.visitWriteVarExpr = function (expr) {
422 return this.postProcess(expr, ts.createAssignment(ts.createIdentifier(expr.name), expr.value.visitExpression(this, null)));
423 };
424 NodeEmitterVisitor.prototype.visitWriteKeyExpr = function (expr) {
425 return this.postProcess(expr, ts.createAssignment(ts.createElementAccess(expr.receiver.visitExpression(this, null), expr.index.visitExpression(this, null)), expr.value.visitExpression(this, null)));
426 };
427 NodeEmitterVisitor.prototype.visitWritePropExpr = function (expr) {
428 return this.postProcess(expr, ts.createAssignment(ts.createPropertyAccess(expr.receiver.visitExpression(this, null), expr.name), expr.value.visitExpression(this, null)));
429 };
430 NodeEmitterVisitor.prototype.visitInvokeMethodExpr = function (expr) {
431 var _this = this;
432 var methodName = getMethodName(expr);
433 return this.postProcess(expr, ts.createCall(ts.createPropertyAccess(expr.receiver.visitExpression(this, null), methodName),
434 /* typeArguments */ undefined, expr.args.map(function (arg) { return arg.visitExpression(_this, null); })));
435 };
436 NodeEmitterVisitor.prototype.visitInvokeFunctionExpr = function (expr) {
437 var _this = this;
438 return this.postProcess(expr, ts.createCall(expr.fn.visitExpression(this, null), /* typeArguments */ undefined, expr.args.map(function (arg) { return arg.visitExpression(_this, null); })));
439 };
440 NodeEmitterVisitor.prototype.visitTaggedTemplateExpr = function (expr) {
441 throw new Error('tagged templates are not supported in pre-ivy mode.');
442 };
443 NodeEmitterVisitor.prototype.visitInstantiateExpr = function (expr) {
444 var _this = this;
445 return this.postProcess(expr, ts.createNew(expr.classExpr.visitExpression(this, null), /* typeArguments */ undefined, expr.args.map(function (arg) { return arg.visitExpression(_this, null); })));
446 };
447 NodeEmitterVisitor.prototype.visitLiteralExpr = function (expr) {
448 return this.postProcess(expr, createLiteral(expr.value));
449 };
450 NodeEmitterVisitor.prototype.visitLocalizedString = function (expr, context) {
451 throw new Error('localized strings are not supported in pre-ivy mode.');
452 };
453 NodeEmitterVisitor.prototype.visitExternalExpr = function (expr) {
454 return this.postProcess(expr, this._visitIdentifier(expr.value));
455 };
456 NodeEmitterVisitor.prototype.visitConditionalExpr = function (expr) {
457 // TODO {chuckj}: Review use of ! on falseCase. Should it be non-nullable?
458 return this.postProcess(expr, ts.createParen(ts.createConditional(expr.condition.visitExpression(this, null), expr.trueCase.visitExpression(this, null), expr.falseCase.visitExpression(this, null))));
459 };
460 NodeEmitterVisitor.prototype.visitNotExpr = function (expr) {
461 return this.postProcess(expr, ts.createPrefix(ts.SyntaxKind.ExclamationToken, expr.condition.visitExpression(this, null)));
462 };
463 NodeEmitterVisitor.prototype.visitAssertNotNullExpr = function (expr) {
464 return expr.condition.visitExpression(this, null);
465 };
466 NodeEmitterVisitor.prototype.visitCastExpr = function (expr) {
467 return expr.value.visitExpression(this, null);
468 };
469 NodeEmitterVisitor.prototype.visitFunctionExpr = function (expr) {
470 return this.postProcess(expr, ts.createFunctionExpression(
471 /* modifiers */ undefined, /* astriskToken */ undefined,
472 /* name */ expr.name || undefined,
473 /* typeParameters */ undefined, expr.params.map(function (p) { return ts.createParameter(
474 /* decorators */ undefined, /* modifiers */ undefined,
475 /* dotDotDotToken */ undefined, p.name); }),
476 /* type */ undefined, this._visitStatements(expr.statements)));
477 };
478 NodeEmitterVisitor.prototype.visitUnaryOperatorExpr = function (expr) {
479 var unaryOperator;
480 switch (expr.operator) {
481 case compiler_1.UnaryOperator.Minus:
482 unaryOperator = ts.SyntaxKind.MinusToken;
483 break;
484 case compiler_1.UnaryOperator.Plus:
485 unaryOperator = ts.SyntaxKind.PlusToken;
486 break;
487 default:
488 throw new Error("Unknown operator: " + expr.operator);
489 }
490 var binary = ts.createPrefix(unaryOperator, expr.expr.visitExpression(this, null));
491 return this.postProcess(expr, expr.parens ? ts.createParen(binary) : binary);
492 };
493 NodeEmitterVisitor.prototype.visitBinaryOperatorExpr = function (expr) {
494 var binaryOperator;
495 switch (expr.operator) {
496 case compiler_1.BinaryOperator.And:
497 binaryOperator = ts.SyntaxKind.AmpersandAmpersandToken;
498 break;
499 case compiler_1.BinaryOperator.BitwiseAnd:
500 binaryOperator = ts.SyntaxKind.AmpersandToken;
501 break;
502 case compiler_1.BinaryOperator.Bigger:
503 binaryOperator = ts.SyntaxKind.GreaterThanToken;
504 break;
505 case compiler_1.BinaryOperator.BiggerEquals:
506 binaryOperator = ts.SyntaxKind.GreaterThanEqualsToken;
507 break;
508 case compiler_1.BinaryOperator.Divide:
509 binaryOperator = ts.SyntaxKind.SlashToken;
510 break;
511 case compiler_1.BinaryOperator.Equals:
512 binaryOperator = ts.SyntaxKind.EqualsEqualsToken;
513 break;
514 case compiler_1.BinaryOperator.Identical:
515 binaryOperator = ts.SyntaxKind.EqualsEqualsEqualsToken;
516 break;
517 case compiler_1.BinaryOperator.Lower:
518 binaryOperator = ts.SyntaxKind.LessThanToken;
519 break;
520 case compiler_1.BinaryOperator.LowerEquals:
521 binaryOperator = ts.SyntaxKind.LessThanEqualsToken;
522 break;
523 case compiler_1.BinaryOperator.Minus:
524 binaryOperator = ts.SyntaxKind.MinusToken;
525 break;
526 case compiler_1.BinaryOperator.Modulo:
527 binaryOperator = ts.SyntaxKind.PercentToken;
528 break;
529 case compiler_1.BinaryOperator.Multiply:
530 binaryOperator = ts.SyntaxKind.AsteriskToken;
531 break;
532 case compiler_1.BinaryOperator.NotEquals:
533 binaryOperator = ts.SyntaxKind.ExclamationEqualsToken;
534 break;
535 case compiler_1.BinaryOperator.NotIdentical:
536 binaryOperator = ts.SyntaxKind.ExclamationEqualsEqualsToken;
537 break;
538 case compiler_1.BinaryOperator.Or:
539 binaryOperator = ts.SyntaxKind.BarBarToken;
540 break;
541 case compiler_1.BinaryOperator.NullishCoalesce:
542 binaryOperator = ts.SyntaxKind.QuestionQuestionToken;
543 break;
544 case compiler_1.BinaryOperator.Plus:
545 binaryOperator = ts.SyntaxKind.PlusToken;
546 break;
547 default:
548 throw new Error("Unknown operator: " + expr.operator);
549 }
550 var binary = ts.createBinary(expr.lhs.visitExpression(this, null), binaryOperator, expr.rhs.visitExpression(this, null));
551 return this.postProcess(expr, expr.parens ? ts.createParen(binary) : binary);
552 };
553 NodeEmitterVisitor.prototype.visitReadPropExpr = function (expr) {
554 return this.postProcess(expr, ts.createPropertyAccess(expr.receiver.visitExpression(this, null), expr.name));
555 };
556 NodeEmitterVisitor.prototype.visitReadKeyExpr = function (expr) {
557 return this.postProcess(expr, ts.createElementAccess(expr.receiver.visitExpression(this, null), expr.index.visitExpression(this, null)));
558 };
559 NodeEmitterVisitor.prototype.visitLiteralArrayExpr = function (expr) {
560 var _this = this;
561 return this.postProcess(expr, ts.createArrayLiteral(expr.entries.map(function (entry) { return entry.visitExpression(_this, null); })));
562 };
563 NodeEmitterVisitor.prototype.visitLiteralMapExpr = function (expr) {
564 var _this = this;
565 return this.postProcess(expr, ts.createObjectLiteral(expr.entries.map(function (entry) { return ts.createPropertyAssignment(entry.quoted || !_VALID_IDENTIFIER_RE.test(entry.key) ?
566 ts.createLiteral(entry.key) :
567 entry.key, entry.value.visitExpression(_this, null)); })));
568 };
569 NodeEmitterVisitor.prototype.visitCommaExpr = function (expr) {
570 var _this = this;
571 return this.postProcess(expr, expr.parts.map(function (e) { return e.visitExpression(_this, null); })
572 .reduce(function (left, right) {
573 return left ? ts.createBinary(left, ts.SyntaxKind.CommaToken, right) : right;
574 }, null));
575 };
576 NodeEmitterVisitor.prototype._visitStatements = function (statements) {
577 return this._visitStatementsPrefix([], statements);
578 };
579 NodeEmitterVisitor.prototype._visitStatementsPrefix = function (prefix, statements) {
580 var _this = this;
581 return ts.createBlock(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(prefix)), tslib_1.__read(statements.map(function (stmt) { return stmt.visitStatement(_this, null); }).filter(function (f) { return f != null; }))));
582 };
583 NodeEmitterVisitor.prototype._visitIdentifier = function (value) {
584 // name can only be null during JIT which never executes this code.
585 var moduleName = value.moduleName, name = value.name;
586 var prefixIdent = null;
587 if (moduleName) {
588 var prefix = this._importsWithPrefixes.get(moduleName);
589 if (prefix == null) {
590 prefix = "i" + this._importsWithPrefixes.size;
591 this._importsWithPrefixes.set(moduleName, prefix);
592 }
593 prefixIdent = ts.createIdentifier(prefix);
594 }
595 if (prefixIdent) {
596 return ts.createPropertyAccess(prefixIdent, name);
597 }
598 else {
599 var id = ts.createIdentifier(name);
600 if (this._exportedVariableIdentifiers.has(name)) {
601 // In order for this new identifier node to be properly rewritten in CommonJS output,
602 // it must have its original node set to a parsed instance of the same identifier.
603 ts.setOriginalNode(id, this._exportedVariableIdentifiers.get(name));
604 }
605 return id;
606 }
607 };
608 return NodeEmitterVisitor;
609 }());
610 exports.NodeEmitterVisitor = NodeEmitterVisitor;
611 function getMethodName(methodRef) {
612 if (methodRef.name) {
613 return methodRef.name;
614 }
615 else {
616 switch (methodRef.builtin) {
617 case compiler_1.BuiltinMethod.Bind:
618 return 'bind';
619 case compiler_1.BuiltinMethod.ConcatArray:
620 return 'concat';
621 case compiler_1.BuiltinMethod.SubscribeObservable:
622 return 'subscribe';
623 }
624 }
625 throw new Error('Unexpected method reference form');
626 }
627 function modifierFromModifier(modifier) {
628 switch (modifier) {
629 case compiler_1.StmtModifier.Exported:
630 return ts.createToken(ts.SyntaxKind.ExportKeyword);
631 case compiler_1.StmtModifier.Final:
632 return ts.createToken(ts.SyntaxKind.ConstKeyword);
633 case compiler_1.StmtModifier.Private:
634 return ts.createToken(ts.SyntaxKind.PrivateKeyword);
635 case compiler_1.StmtModifier.Static:
636 return ts.createToken(ts.SyntaxKind.StaticKeyword);
637 }
638 }
639 function translateModifiers(modifiers) {
640 return modifiers == null ? undefined : modifiers.map(modifierFromModifier);
641 }
642});
643//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZV9lbWl0dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGl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uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbW9kaWZpZXJzICovIHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHBhcmFtZXRlcnMgKi9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0bXQuY29uc3RydWN0b3JNZXRob2QucGFyYW1zLm1hcChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwID0+IHRzLmNyZWF0ZVBhcmFtZXRlcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZGVjb3JhdG9ycyAqLyB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG1vZGlmaWVycyAqLyB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRvdERvdERvdFRva2VuICovIHVuZGVmaW5lZCwgcC5uYW1lKSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl92aXNpdFN0YXRlbWVudHMoc3RtdC5jb25zdHJ1Y3Rvck1ldGhvZC5ib2R5KSldKSB8fFxuICAgICAgICBbXTtcblxuICAgIC8vIFRPRE8ge2NodWNran06IERldGVybWluZSB3aGF0IHNob3VsZCBiZSBkb25lIGZvciBhIG1ldGhvZCB3aXRoIGEgbnVsbCBuYW1lLlxuICAgIGNvbnN0IG1ldGhvZHMgPSBzdG10Lm1ldGhvZHMuZmlsdGVyKG1ldGhvZCA9PiBtZXRob2QubmFtZSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kID0+IHRzLmNyZWF0ZU1ldGhvZChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZGVjb3JhdG9ycyAqLyB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG1vZGlmaWVycyAqLyB0cmFuc2xhdGVNb2RpZmllcnMobWV0aG9kLm1vZGlmaWVycyksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFzdHJpc2tUb2tlbiAqLyB1bmRlZmluZWQsIG1ldGhvZC5uYW1lIS8qIGd1YXJkZWQgYnkgZmlsdGVyICovLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBxdWVzdGlvblRva2VuICovIHVuZGVmaW5lZCwgLyogdHlwZVBhcmFtZXRlcnMgKi8gdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2QucGFyYW1zLm1hcChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAgPT4gdHMuY3JlYXRlUGFyYW1ldGVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRlY29yYXRvcnMgKi8gdW5kZWZpbmVkLCAvKiBtb2RpZmllcnMgKi8gdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRvdERvdERvdFRva2VuICovIHVuZGVmaW5lZCwgcC5uYW1lKSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHR5cGUgKi8gdW5kZWZpbmVkLCB0aGlzLl92aXNpdFN0YXRlbWVudHMobWV0aG9kLmJvZHkpKSk7XG4gICAgcmV0dXJuIHRoaXMucG9zdFByb2Nlc3MoXG4gICAgICAgIHN0bXQsXG4gICAgICAgIHRzLmNyZWF0ZUNsYXNzRGVjbGFyYXRpb24oXG4gICAgICAgICAgICAvKiBkZWNvcmF0b3JzICovIHVuZGVmaW5lZCwgbW9kaWZpZXJzLCBzdG10Lm5hbWUsIC8qIHR5cGVQYXJhbWV0ZXJzKi8gdW5kZWZpbmVkLFxuICAgIC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BDQVRDSF9FUlJPUl9OQU1FLFxuICAgICAgICAgICAgICAgIHRoaXMuX3Zpc2l0U3RhdGVtZW50c1ByZWZpeChcbiAgICAgICAgICAgICAgICAgICAgW3RzLmNyZWF0ZVZhcmlhYmxlU3RhdGVtZW50KFxuICAgICAgICAgICAgICAgICAgICAgICAgLyogbW9kaWZpZXJzICovIHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIFt0cy5jcmVhdGVWYXJpYWJsZURlY2xhcmF0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENBVENIX1NUQUNLX05BTUUsIC8qIHR5cGUgKi8gdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRzLmNyZWF0ZVByb3BlcnR5QWNjZXNzKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cy5jcmVhdGVJZGVudGlmaWVyKENBVENIX0VSUk9SX05BTUUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cy5jcmVhdGVJZGVudGlmaWVyKENBVENIX1NUQUNLX05BTUUpKSldKV0sXG4gICAgICAgICAgICAgICAgICAgIHN0bXQuY2F0Y2hTdG10cykpLFxuICAgICAgICAgICAgLyogZmluYWxseUJsb2NrICovIHVuZGVmaW5lZCkpO1xuICB9XG5cbiAgdmlzaXRUaHJvd1N0bXQoc3RtdDogVGhyb3dTdG10KSB7XG4gICAgcmV0dXJuIHRoaXMucG9zdFByb2Nlc3Moc3RtdCwgdHMuY3JlYXRlVGhyb3coc3RtdC5lcnJvci52aXNpdEV4cHJlc3Npb24odGhpcywgbnVsbCkpKTtcbiAgfVxuXG4gIC8vIEV4cHJlc3Npb25WaXNpdG9yXG4gIHZpc2l0V3JhcHBlZE5vZGVFeHByKGV4cHI6IFdyYXBwZWROb2RlRXhwcjxhbnk+KSB7XG4gICAgcmV0dXJuIHRoaXMucG9zdFByb2Nlc3MoZXhwciwgZXhwci5ub2RlKTtcbiAgfVxuXG4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