source: trip-planner-front/node_modules/@angular/compiler/src/output/output_interpreter.js@ 76712b2

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

initial commit

  • Property mode set to 100644
File size: 58.0 KB
Line 
1(function (factory) {
2 if (typeof module === "object" && typeof module.exports === "object") {
3 var v = factory(require, exports);
4 if (v !== undefined) module.exports = v;
5 }
6 else if (typeof define === "function" && define.amd) {
7 define("@angular/compiler/src/output/output_interpreter", ["require", "exports", "tslib", "@angular/compiler/src/output/output_ast", "@angular/compiler/src/output/ts_emitter"], factory);
8 }
9})(function (require, exports) {
10 "use strict";
11 Object.defineProperty(exports, "__esModule", { value: true });
12 exports.interpretStatements = void 0;
13 var tslib_1 = require("tslib");
14 var o = require("@angular/compiler/src/output/output_ast");
15 var ts_emitter_1 = require("@angular/compiler/src/output/ts_emitter");
16 function interpretStatements(statements, reflector) {
17 var ctx = new _ExecutionContext(null, null, null, new Map());
18 var visitor = new StatementInterpreter(reflector);
19 visitor.visitAllStatements(statements, ctx);
20 var result = {};
21 ctx.exports.forEach(function (exportName) {
22 result[exportName] = ctx.vars.get(exportName);
23 });
24 return result;
25 }
26 exports.interpretStatements = interpretStatements;
27 function _executeFunctionStatements(varNames, varValues, statements, ctx, visitor) {
28 var childCtx = ctx.createChildWihtLocalVars();
29 for (var i = 0; i < varNames.length; i++) {
30 childCtx.vars.set(varNames[i], varValues[i]);
31 }
32 var result = visitor.visitAllStatements(statements, childCtx);
33 return result ? result.value : null;
34 }
35 var _ExecutionContext = /** @class */ (function () {
36 function _ExecutionContext(parent, instance, className, vars) {
37 this.parent = parent;
38 this.instance = instance;
39 this.className = className;
40 this.vars = vars;
41 this.exports = [];
42 }
43 _ExecutionContext.prototype.createChildWihtLocalVars = function () {
44 return new _ExecutionContext(this, this.instance, this.className, new Map());
45 };
46 return _ExecutionContext;
47 }());
48 var ReturnValue = /** @class */ (function () {
49 function ReturnValue(value) {
50 this.value = value;
51 }
52 return ReturnValue;
53 }());
54 function createDynamicClass(_classStmt, _ctx, _visitor) {
55 var propertyDescriptors = {};
56 _classStmt.getters.forEach(function (getter) {
57 // Note: use `function` instead of arrow function to capture `this`
58 propertyDescriptors[getter.name] = {
59 configurable: false,
60 get: function () {
61 var instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);
62 return _executeFunctionStatements([], [], getter.body, instanceCtx, _visitor);
63 }
64 };
65 });
66 _classStmt.methods.forEach(function (method) {
67 var paramNames = method.params.map(function (param) { return param.name; });
68 // Note: use `function` instead of arrow function to capture `this`
69 propertyDescriptors[method.name] = {
70 writable: false,
71 configurable: false,
72 value: function () {
73 var args = [];
74 for (var _i = 0; _i < arguments.length; _i++) {
75 args[_i] = arguments[_i];
76 }
77 var instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);
78 return _executeFunctionStatements(paramNames, args, method.body, instanceCtx, _visitor);
79 }
80 };
81 });
82 var ctorParamNames = _classStmt.constructorMethod.params.map(function (param) { return param.name; });
83 // Note: use `function` instead of arrow function to capture `this`
84 var ctor = function () {
85 var _this = this;
86 var args = [];
87 for (var _i = 0; _i < arguments.length; _i++) {
88 args[_i] = arguments[_i];
89 }
90 var instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);
91 _classStmt.fields.forEach(function (field) {
92 _this[field.name] = undefined;
93 });
94 _executeFunctionStatements(ctorParamNames, args, _classStmt.constructorMethod.body, instanceCtx, _visitor);
95 };
96 var superClass = _classStmt.parent ? _classStmt.parent.visitExpression(_visitor, _ctx) : Object;
97 ctor.prototype = Object.create(superClass.prototype, propertyDescriptors);
98 return ctor;
99 }
100 var StatementInterpreter = /** @class */ (function () {
101 function StatementInterpreter(reflector) {
102 this.reflector = reflector;
103 }
104 StatementInterpreter.prototype.debugAst = function (ast) {
105 return ts_emitter_1.debugOutputAstAsTypeScript(ast);
106 };
107 StatementInterpreter.prototype.visitDeclareVarStmt = function (stmt, ctx) {
108 var initialValue = stmt.value ? stmt.value.visitExpression(this, ctx) : undefined;
109 ctx.vars.set(stmt.name, initialValue);
110 if (stmt.hasModifier(o.StmtModifier.Exported)) {
111 ctx.exports.push(stmt.name);
112 }
113 return null;
114 };
115 StatementInterpreter.prototype.visitWriteVarExpr = function (expr, ctx) {
116 var value = expr.value.visitExpression(this, ctx);
117 var currCtx = ctx;
118 while (currCtx != null) {
119 if (currCtx.vars.has(expr.name)) {
120 currCtx.vars.set(expr.name, value);
121 return value;
122 }
123 currCtx = currCtx.parent;
124 }
125 throw new Error("Not declared variable " + expr.name);
126 };
127 StatementInterpreter.prototype.visitWrappedNodeExpr = function (ast, ctx) {
128 throw new Error('Cannot interpret a WrappedNodeExpr.');
129 };
130 StatementInterpreter.prototype.visitTypeofExpr = function (ast, ctx) {
131 throw new Error('Cannot interpret a TypeofExpr');
132 };
133 StatementInterpreter.prototype.visitReadVarExpr = function (ast, ctx) {
134 var varName = ast.name;
135 if (ast.builtin != null) {
136 switch (ast.builtin) {
137 case o.BuiltinVar.Super:
138 return Object.getPrototypeOf(ctx.instance);
139 case o.BuiltinVar.This:
140 return ctx.instance;
141 case o.BuiltinVar.CatchError:
142 varName = CATCH_ERROR_VAR;
143 break;
144 case o.BuiltinVar.CatchStack:
145 varName = CATCH_STACK_VAR;
146 break;
147 default:
148 throw new Error("Unknown builtin variable " + ast.builtin);
149 }
150 }
151 var currCtx = ctx;
152 while (currCtx != null) {
153 if (currCtx.vars.has(varName)) {
154 return currCtx.vars.get(varName);
155 }
156 currCtx = currCtx.parent;
157 }
158 throw new Error("Not declared variable " + varName);
159 };
160 StatementInterpreter.prototype.visitWriteKeyExpr = function (expr, ctx) {
161 var receiver = expr.receiver.visitExpression(this, ctx);
162 var index = expr.index.visitExpression(this, ctx);
163 var value = expr.value.visitExpression(this, ctx);
164 receiver[index] = value;
165 return value;
166 };
167 StatementInterpreter.prototype.visitWritePropExpr = function (expr, ctx) {
168 var receiver = expr.receiver.visitExpression(this, ctx);
169 var value = expr.value.visitExpression(this, ctx);
170 receiver[expr.name] = value;
171 return value;
172 };
173 StatementInterpreter.prototype.visitInvokeMethodExpr = function (expr, ctx) {
174 var receiver = expr.receiver.visitExpression(this, ctx);
175 var args = this.visitAllExpressions(expr.args, ctx);
176 var result;
177 if (expr.builtin != null) {
178 switch (expr.builtin) {
179 case o.BuiltinMethod.ConcatArray:
180 result = receiver.concat.apply(receiver, tslib_1.__spreadArray([], tslib_1.__read(args)));
181 break;
182 case o.BuiltinMethod.SubscribeObservable:
183 result = receiver.subscribe({ next: args[0] });
184 break;
185 case o.BuiltinMethod.Bind:
186 result = receiver.bind.apply(receiver, tslib_1.__spreadArray([], tslib_1.__read(args)));
187 break;
188 default:
189 throw new Error("Unknown builtin method " + expr.builtin);
190 }
191 }
192 else {
193 result = receiver[expr.name].apply(receiver, args);
194 }
195 return result;
196 };
197 StatementInterpreter.prototype.visitInvokeFunctionExpr = function (stmt, ctx) {
198 var args = this.visitAllExpressions(stmt.args, ctx);
199 var fnExpr = stmt.fn;
200 if (fnExpr instanceof o.ReadVarExpr && fnExpr.builtin === o.BuiltinVar.Super) {
201 ctx.instance.constructor.prototype.constructor.apply(ctx.instance, args);
202 return null;
203 }
204 else {
205 var fn = stmt.fn.visitExpression(this, ctx);
206 return fn.apply(null, args);
207 }
208 };
209 StatementInterpreter.prototype.visitTaggedTemplateExpr = function (expr, ctx) {
210 var templateElements = expr.template.elements.map(function (e) { return e.text; });
211 Object.defineProperty(templateElements, 'raw', { value: expr.template.elements.map(function (e) { return e.rawText; }) });
212 var args = this.visitAllExpressions(expr.template.expressions, ctx);
213 args.unshift(templateElements);
214 var tag = expr.tag.visitExpression(this, ctx);
215 return tag.apply(null, args);
216 };
217 StatementInterpreter.prototype.visitReturnStmt = function (stmt, ctx) {
218 return new ReturnValue(stmt.value.visitExpression(this, ctx));
219 };
220 StatementInterpreter.prototype.visitDeclareClassStmt = function (stmt, ctx) {
221 var clazz = createDynamicClass(stmt, ctx, this);
222 ctx.vars.set(stmt.name, clazz);
223 if (stmt.hasModifier(o.StmtModifier.Exported)) {
224 ctx.exports.push(stmt.name);
225 }
226 return null;
227 };
228 StatementInterpreter.prototype.visitExpressionStmt = function (stmt, ctx) {
229 return stmt.expr.visitExpression(this, ctx);
230 };
231 StatementInterpreter.prototype.visitIfStmt = function (stmt, ctx) {
232 var condition = stmt.condition.visitExpression(this, ctx);
233 if (condition) {
234 return this.visitAllStatements(stmt.trueCase, ctx);
235 }
236 else if (stmt.falseCase != null) {
237 return this.visitAllStatements(stmt.falseCase, ctx);
238 }
239 return null;
240 };
241 StatementInterpreter.prototype.visitTryCatchStmt = function (stmt, ctx) {
242 try {
243 return this.visitAllStatements(stmt.bodyStmts, ctx);
244 }
245 catch (e) {
246 var childCtx = ctx.createChildWihtLocalVars();
247 childCtx.vars.set(CATCH_ERROR_VAR, e);
248 childCtx.vars.set(CATCH_STACK_VAR, e.stack);
249 return this.visitAllStatements(stmt.catchStmts, childCtx);
250 }
251 };
252 StatementInterpreter.prototype.visitThrowStmt = function (stmt, ctx) {
253 throw stmt.error.visitExpression(this, ctx);
254 };
255 StatementInterpreter.prototype.visitInstantiateExpr = function (ast, ctx) {
256 var args = this.visitAllExpressions(ast.args, ctx);
257 var clazz = ast.classExpr.visitExpression(this, ctx);
258 return new (clazz.bind.apply(clazz, tslib_1.__spreadArray([void 0], tslib_1.__read(args))))();
259 };
260 StatementInterpreter.prototype.visitLiteralExpr = function (ast, ctx) {
261 return ast.value;
262 };
263 StatementInterpreter.prototype.visitLocalizedString = function (ast, context) {
264 return null;
265 };
266 StatementInterpreter.prototype.visitExternalExpr = function (ast, ctx) {
267 return this.reflector.resolveExternalReference(ast.value);
268 };
269 StatementInterpreter.prototype.visitConditionalExpr = function (ast, ctx) {
270 if (ast.condition.visitExpression(this, ctx)) {
271 return ast.trueCase.visitExpression(this, ctx);
272 }
273 else if (ast.falseCase != null) {
274 return ast.falseCase.visitExpression(this, ctx);
275 }
276 return null;
277 };
278 StatementInterpreter.prototype.visitNotExpr = function (ast, ctx) {
279 return !ast.condition.visitExpression(this, ctx);
280 };
281 StatementInterpreter.prototype.visitAssertNotNullExpr = function (ast, ctx) {
282 return ast.condition.visitExpression(this, ctx);
283 };
284 StatementInterpreter.prototype.visitCastExpr = function (ast, ctx) {
285 return ast.value.visitExpression(this, ctx);
286 };
287 StatementInterpreter.prototype.visitFunctionExpr = function (ast, ctx) {
288 var paramNames = ast.params.map(function (param) { return param.name; });
289 return _declareFn(paramNames, ast.statements, ctx, this);
290 };
291 StatementInterpreter.prototype.visitDeclareFunctionStmt = function (stmt, ctx) {
292 var paramNames = stmt.params.map(function (param) { return param.name; });
293 ctx.vars.set(stmt.name, _declareFn(paramNames, stmt.statements, ctx, this));
294 if (stmt.hasModifier(o.StmtModifier.Exported)) {
295 ctx.exports.push(stmt.name);
296 }
297 return null;
298 };
299 StatementInterpreter.prototype.visitUnaryOperatorExpr = function (ast, ctx) {
300 var _this = this;
301 var rhs = function () { return ast.expr.visitExpression(_this, ctx); };
302 switch (ast.operator) {
303 case o.UnaryOperator.Plus:
304 return +rhs();
305 case o.UnaryOperator.Minus:
306 return -rhs();
307 default:
308 throw new Error("Unknown operator " + ast.operator);
309 }
310 };
311 StatementInterpreter.prototype.visitBinaryOperatorExpr = function (ast, ctx) {
312 var _this = this;
313 var _a;
314 var lhs = function () { return ast.lhs.visitExpression(_this, ctx); };
315 var rhs = function () { return ast.rhs.visitExpression(_this, ctx); };
316 switch (ast.operator) {
317 case o.BinaryOperator.Equals:
318 return lhs() == rhs();
319 case o.BinaryOperator.Identical:
320 return lhs() === rhs();
321 case o.BinaryOperator.NotEquals:
322 return lhs() != rhs();
323 case o.BinaryOperator.NotIdentical:
324 return lhs() !== rhs();
325 case o.BinaryOperator.And:
326 return lhs() && rhs();
327 case o.BinaryOperator.Or:
328 return lhs() || rhs();
329 case o.BinaryOperator.Plus:
330 return lhs() + rhs();
331 case o.BinaryOperator.Minus:
332 return lhs() - rhs();
333 case o.BinaryOperator.Divide:
334 return lhs() / rhs();
335 case o.BinaryOperator.Multiply:
336 return lhs() * rhs();
337 case o.BinaryOperator.Modulo:
338 return lhs() % rhs();
339 case o.BinaryOperator.Lower:
340 return lhs() < rhs();
341 case o.BinaryOperator.LowerEquals:
342 return lhs() <= rhs();
343 case o.BinaryOperator.Bigger:
344 return lhs() > rhs();
345 case o.BinaryOperator.BiggerEquals:
346 return lhs() >= rhs();
347 case o.BinaryOperator.NullishCoalesce:
348 return (_a = lhs()) !== null && _a !== void 0 ? _a : rhs();
349 default:
350 throw new Error("Unknown operator " + ast.operator);
351 }
352 };
353 StatementInterpreter.prototype.visitReadPropExpr = function (ast, ctx) {
354 var result;
355 var receiver = ast.receiver.visitExpression(this, ctx);
356 result = receiver[ast.name];
357 return result;
358 };
359 StatementInterpreter.prototype.visitReadKeyExpr = function (ast, ctx) {
360 var receiver = ast.receiver.visitExpression(this, ctx);
361 var prop = ast.index.visitExpression(this, ctx);
362 return receiver[prop];
363 };
364 StatementInterpreter.prototype.visitLiteralArrayExpr = function (ast, ctx) {
365 return this.visitAllExpressions(ast.entries, ctx);
366 };
367 StatementInterpreter.prototype.visitLiteralMapExpr = function (ast, ctx) {
368 var _this = this;
369 var result = {};
370 ast.entries.forEach(function (entry) { return result[entry.key] = entry.value.visitExpression(_this, ctx); });
371 return result;
372 };
373 StatementInterpreter.prototype.visitCommaExpr = function (ast, context) {
374 var values = this.visitAllExpressions(ast.parts, context);
375 return values[values.length - 1];
376 };
377 StatementInterpreter.prototype.visitAllExpressions = function (expressions, ctx) {
378 var _this = this;
379 return expressions.map(function (expr) { return expr.visitExpression(_this, ctx); });
380 };
381 StatementInterpreter.prototype.visitAllStatements = function (statements, ctx) {
382 for (var i = 0; i < statements.length; i++) {
383 var stmt = statements[i];
384 var val = stmt.visitStatement(this, ctx);
385 if (val instanceof ReturnValue) {
386 return val;
387 }
388 }
389 return null;
390 };
391 return StatementInterpreter;
392 }());
393 function _declareFn(varNames, statements, ctx, visitor) {
394 return function () {
395 var args = [];
396 for (var _i = 0; _i < arguments.length; _i++) {
397 args[_i] = arguments[_i];
398 }
399 return _executeFunctionStatements(varNames, args, statements, ctx, visitor);
400 };
401 }
402 var CATCH_ERROR_VAR = 'error';
403 var CATCH_STACK_VAR = 'stack';
404});
405//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0cHV0X2ludGVycHJldGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXIvc3JjL291dHB1dC9vdXRwdXRfaW50ZXJwcmV0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztJQVFBLDJEQUFrQztJQUNsQyxzRUFBd0Q7SUFFeEQsU0FBZ0IsbUJBQW1CLENBQy9CLFVBQXlCLEVBQUUsU0FBMkI7UUFDeEQsSUFBTSxHQUFHLEdBQUcsSUFBSSxpQkFBaUIsQ0FBQyxJQUFJLEVBQUUsSUFBSSxFQUFFLElBQUksRUFBRSxJQUFJLEdBQUcsRUFBZSxDQUFDLENBQUM7UUFDNUUsSUFBTSxPQUFPLEdBQUcsSUFBSSxvQkFBb0IsQ0FBQyxTQUFTLENBQUMsQ0FBQztRQUNwRCxPQUFPLENBQUMsa0JBQWtCLENBQUMsVUFBVSxFQUFFLEdBQUcsQ0FBQyxDQUFDO1FBQzVDLElBQU0sTUFBTSxHQUF5QixFQUFFLENBQUM7UUFDeEMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsVUFBQyxVQUFVO1lBQzdCLE1BQU0sQ0FBQyxVQUFVLENBQUMsR0FBRyxHQUFHLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQztRQUNoRCxDQUFDLENBQUMsQ0FBQztRQUNILE9BQU8sTUFBTSxDQUFDO0lBQ2hCLENBQUM7SUFWRCxrREFVQztJQUVELFNB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