source: trip-planner-front/node_modules/@angular/compiler/src/aot/static_symbol.js@ 6a80231

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

initial commit

  • Property mode set to 100644
File size: 5.6 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/src/aot/static_symbol", ["require", "exports"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.StaticSymbolCache = exports.StaticSymbol = void 0;
20 /**
21 * A token representing the a reference to a static type.
22 *
23 * This token is unique for a filePath and name and can be used as a hash table key.
24 */
25 var StaticSymbol = /** @class */ (function () {
26 function StaticSymbol(filePath, name, members) {
27 this.filePath = filePath;
28 this.name = name;
29 this.members = members;
30 }
31 StaticSymbol.prototype.assertNoMembers = function () {
32 if (this.members.length) {
33 throw new Error("Illegal state: symbol without members expected, but got " + JSON.stringify(this) + ".");
34 }
35 };
36 return StaticSymbol;
37 }());
38 exports.StaticSymbol = StaticSymbol;
39 /**
40 * A cache of static symbol used by the StaticReflector to return the same symbol for the
41 * same symbol values.
42 */
43 var StaticSymbolCache = /** @class */ (function () {
44 function StaticSymbolCache() {
45 this.cache = new Map();
46 }
47 StaticSymbolCache.prototype.get = function (declarationFile, name, members) {
48 members = members || [];
49 var memberSuffix = members.length ? "." + members.join('.') : '';
50 var key = "\"" + declarationFile + "\"." + name + memberSuffix;
51 var result = this.cache.get(key);
52 if (!result) {
53 result = new StaticSymbol(declarationFile, name, members);
54 this.cache.set(key, result);
55 }
56 return result;
57 };
58 return StaticSymbolCache;
59 }());
60 exports.StaticSymbolCache = StaticSymbolCache;
61});
62//# sourceMappingURL=data:application/json;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