/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define("@angular/compiler/src/aot/static_symbol", ["require", "exports"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StaticSymbolCache = exports.StaticSymbol = void 0; /** * A token representing the a reference to a static type. * * This token is unique for a filePath and name and can be used as a hash table key. */ var StaticSymbol = /** @class */ (function () { function StaticSymbol(filePath, name, members) { this.filePath = filePath; this.name = name; this.members = members; } StaticSymbol.prototype.assertNoMembers = function () { if (this.members.length) { throw new Error("Illegal state: symbol without members expected, but got " + JSON.stringify(this) + "."); } }; return StaticSymbol; }()); exports.StaticSymbol = StaticSymbol; /** * A cache of static symbol used by the StaticReflector to return the same symbol for the * same symbol values. */ var StaticSymbolCache = /** @class */ (function () { function StaticSymbolCache() { this.cache = new Map(); } StaticSymbolCache.prototype.get = function (declarationFile, name, members) { members = members || []; var memberSuffix = members.length ? "." + members.join('.') : ''; var key = "\"" + declarationFile + "\"." + name + memberSuffix; var result = this.cache.get(key); if (!result) { result = new StaticSymbol(declarationFile, name, members); this.cache.set(key, result); } return result; }; return StaticSymbolCache; }()); exports.StaticSymbolCache = StaticSymbolCache; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdGljX3N5bWJvbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyL3NyYy9hb3Qvc3RhdGljX3N5bWJvbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7SUFFSDs7OztPQUlHO0lBQ0g7UUFDRSxzQkFBbUIsU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