source: trip-planner-front/node_modules/@angular/compiler/src/metadata_resolver.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: 174.5 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/metadata_resolver", ["require", "exports", "tslib", "@angular/compiler/src/aot/static_symbol", "@angular/compiler/src/aot/util", "@angular/compiler/src/assertions", "@angular/compiler/src/compile_metadata", "@angular/compiler/src/core", "@angular/compiler/src/directive_resolver", "@angular/compiler/src/identifiers", "@angular/compiler/src/lifecycle_reflector", "@angular/compiler/src/parse_util", "@angular/compiler/src/selector", "@angular/compiler/src/util"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.CompileMetadataResolver = exports.getMissingNgModuleMetadataErrorData = exports.ERROR_COMPONENT_TYPE = void 0;
20 var tslib_1 = require("tslib");
21 var static_symbol_1 = require("@angular/compiler/src/aot/static_symbol");
22 var util_1 = require("@angular/compiler/src/aot/util");
23 var assertions_1 = require("@angular/compiler/src/assertions");
24 var cpl = require("@angular/compiler/src/compile_metadata");
25 var core_1 = require("@angular/compiler/src/core");
26 var directive_resolver_1 = require("@angular/compiler/src/directive_resolver");
27 var identifiers_1 = require("@angular/compiler/src/identifiers");
28 var lifecycle_reflector_1 = require("@angular/compiler/src/lifecycle_reflector");
29 var parse_util_1 = require("@angular/compiler/src/parse_util");
30 var selector_1 = require("@angular/compiler/src/selector");
31 var util_2 = require("@angular/compiler/src/util");
32 exports.ERROR_COMPONENT_TYPE = 'ngComponentType';
33 var MISSING_NG_MODULE_METADATA_ERROR_DATA = 'ngMissingNgModuleMetadataErrorData';
34 function getMissingNgModuleMetadataErrorData(error) {
35 var _a;
36 return (_a = error[MISSING_NG_MODULE_METADATA_ERROR_DATA]) !== null && _a !== void 0 ? _a : null;
37 }
38 exports.getMissingNgModuleMetadataErrorData = getMissingNgModuleMetadataErrorData;
39 // Design notes:
40 // - don't lazily create metadata:
41 // For some metadata, we need to do async work sometimes,
42 // so the user has to kick off this loading.
43 // But we want to report errors even when the async work is
44 // not required to check that the user would have been able
45 // to wait correctly.
46 var CompileMetadataResolver = /** @class */ (function () {
47 function CompileMetadataResolver(_config, _htmlParser, _ngModuleResolver, _directiveResolver, _pipeResolver, _summaryResolver, _schemaRegistry, _directiveNormalizer, _console, _staticSymbolCache, _reflector, _errorCollector) {
48 this._config = _config;
49 this._htmlParser = _htmlParser;
50 this._ngModuleResolver = _ngModuleResolver;
51 this._directiveResolver = _directiveResolver;
52 this._pipeResolver = _pipeResolver;
53 this._summaryResolver = _summaryResolver;
54 this._schemaRegistry = _schemaRegistry;
55 this._directiveNormalizer = _directiveNormalizer;
56 this._console = _console;
57 this._staticSymbolCache = _staticSymbolCache;
58 this._reflector = _reflector;
59 this._errorCollector = _errorCollector;
60 this._nonNormalizedDirectiveCache = new Map();
61 this._directiveCache = new Map();
62 this._summaryCache = new Map();
63 this._pipeCache = new Map();
64 this._ngModuleCache = new Map();
65 this._ngModuleOfTypes = new Map();
66 this._shallowModuleCache = new Map();
67 }
68 CompileMetadataResolver.prototype.getReflector = function () {
69 return this._reflector;
70 };
71 CompileMetadataResolver.prototype.clearCacheFor = function (type) {
72 var dirMeta = this._directiveCache.get(type);
73 this._directiveCache.delete(type);
74 this._nonNormalizedDirectiveCache.delete(type);
75 this._summaryCache.delete(type);
76 this._pipeCache.delete(type);
77 this._ngModuleOfTypes.delete(type);
78 // Clear all of the NgModule as they contain transitive information!
79 this._ngModuleCache.clear();
80 if (dirMeta) {
81 this._directiveNormalizer.clearCacheFor(dirMeta);
82 }
83 };
84 CompileMetadataResolver.prototype.clearCache = function () {
85 this._directiveCache.clear();
86 this._nonNormalizedDirectiveCache.clear();
87 this._summaryCache.clear();
88 this._pipeCache.clear();
89 this._ngModuleCache.clear();
90 this._ngModuleOfTypes.clear();
91 this._directiveNormalizer.clearCache();
92 };
93 CompileMetadataResolver.prototype._createProxyClass = function (baseType, name) {
94 var delegate = null;
95 var proxyClass = function () {
96 if (!delegate) {
97 throw new Error("Illegal state: Class " + name + " for type " + util_2.stringify(baseType) + " is not compiled yet!");
98 }
99 return delegate.apply(this, arguments);
100 };
101 proxyClass.setDelegate = function (d) {
102 delegate = d;
103 proxyClass.prototype = d.prototype;
104 };
105 // Make stringify work correctly
106 proxyClass.overriddenName = name;
107 return proxyClass;
108 };
109 CompileMetadataResolver.prototype.getGeneratedClass = function (dirType, name) {
110 if (dirType instanceof static_symbol_1.StaticSymbol) {
111 return this._staticSymbolCache.get(util_1.ngfactoryFilePath(dirType.filePath), name);
112 }
113 else {
114 return this._createProxyClass(dirType, name);
115 }
116 };
117 CompileMetadataResolver.prototype.getComponentViewClass = function (dirType) {
118 return this.getGeneratedClass(dirType, cpl.viewClassName(dirType, 0));
119 };
120 CompileMetadataResolver.prototype.getHostComponentViewClass = function (dirType) {
121 return this.getGeneratedClass(dirType, cpl.hostViewClassName(dirType));
122 };
123 CompileMetadataResolver.prototype.getHostComponentType = function (dirType) {
124 var name = parse_util_1.identifierName({ reference: dirType }) + "_Host";
125 if (dirType instanceof static_symbol_1.StaticSymbol) {
126 return this._staticSymbolCache.get(dirType.filePath, name);
127 }
128 return this._createProxyClass(dirType, name);
129 };
130 CompileMetadataResolver.prototype.getRendererType = function (dirType) {
131 if (dirType instanceof static_symbol_1.StaticSymbol) {
132 return this._staticSymbolCache.get(util_1.ngfactoryFilePath(dirType.filePath), cpl.rendererTypeName(dirType));
133 }
134 else {
135 // returning an object as proxy,
136 // that we fill later during runtime compilation.
137 return {};
138 }
139 };
140 CompileMetadataResolver.prototype.getComponentFactory = function (selector, dirType, inputs, outputs) {
141 if (dirType instanceof static_symbol_1.StaticSymbol) {
142 return this._staticSymbolCache.get(util_1.ngfactoryFilePath(dirType.filePath), cpl.componentFactoryName(dirType));
143 }
144 else {
145 var hostView = this.getHostComponentViewClass(dirType);
146 // Note: ngContentSelectors will be filled later once the template is
147 // loaded.
148 var createComponentFactory = this._reflector.resolveExternalReference(identifiers_1.Identifiers.createComponentFactory);
149 return createComponentFactory(selector, dirType, hostView, inputs, outputs, []);
150 }
151 };
152 CompileMetadataResolver.prototype.initComponentFactory = function (factory, ngContentSelectors) {
153 var _a;
154 if (!(factory instanceof static_symbol_1.StaticSymbol)) {
155 (_a = factory.ngContentSelectors).push.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(ngContentSelectors)));
156 }
157 };
158 CompileMetadataResolver.prototype._loadSummary = function (type, kind) {
159 var typeSummary = this._summaryCache.get(type);
160 if (!typeSummary) {
161 var summary = this._summaryResolver.resolveSummary(type);
162 typeSummary = summary ? summary.type : null;
163 this._summaryCache.set(type, typeSummary || null);
164 }
165 return typeSummary && typeSummary.summaryKind === kind ? typeSummary : null;
166 };
167 CompileMetadataResolver.prototype.getHostComponentMetadata = function (compMeta, hostViewType) {
168 var hostType = this.getHostComponentType(compMeta.type.reference);
169 if (!hostViewType) {
170 hostViewType = this.getHostComponentViewClass(hostType);
171 }
172 // Note: ! is ok here as this method should only be called with normalized directive
173 // metadata, which always fills in the selector.
174 var template = selector_1.CssSelector.parse(compMeta.selector)[0].getMatchingElementTemplate();
175 var templateUrl = '';
176 var htmlAst = this._htmlParser.parse(template, templateUrl);
177 return cpl.CompileDirectiveMetadata.create({
178 isHost: true,
179 type: { reference: hostType, diDeps: [], lifecycleHooks: [] },
180 template: new cpl.CompileTemplateMetadata({
181 encapsulation: core_1.ViewEncapsulation.None,
182 template: template,
183 templateUrl: templateUrl,
184 htmlAst: htmlAst,
185 styles: [],
186 styleUrls: [],
187 ngContentSelectors: [],
188 animations: [],
189 isInline: true,
190 externalStylesheets: [],
191 interpolation: null,
192 preserveWhitespaces: false,
193 }),
194 exportAs: null,
195 changeDetection: core_1.ChangeDetectionStrategy.Default,
196 inputs: [],
197 outputs: [],
198 host: {},
199 isComponent: true,
200 selector: '*',
201 providers: [],
202 viewProviders: [],
203 queries: [],
204 guards: {},
205 viewQueries: [],
206 componentViewType: hostViewType,
207 rendererType: { id: '__Host__', encapsulation: core_1.ViewEncapsulation.None, styles: [], data: {} },
208 entryComponents: [],
209 componentFactory: null
210 });
211 };
212 CompileMetadataResolver.prototype.loadDirectiveMetadata = function (ngModuleType, directiveType, isSync) {
213 var _this = this;
214 if (this._directiveCache.has(directiveType)) {
215 return null;
216 }
217 directiveType = util_2.resolveForwardRef(directiveType);
218 var _a = this.getNonNormalizedDirectiveMetadata(directiveType), annotation = _a.annotation, metadata = _a.metadata;
219 var createDirectiveMetadata = function (templateMetadata) {
220 var normalizedDirMeta = new cpl.CompileDirectiveMetadata({
221 isHost: false,
222 type: metadata.type,
223 isComponent: metadata.isComponent,
224 selector: metadata.selector,
225 exportAs: metadata.exportAs,
226 changeDetection: metadata.changeDetection,
227 inputs: metadata.inputs,
228 outputs: metadata.outputs,
229 hostListeners: metadata.hostListeners,
230 hostProperties: metadata.hostProperties,
231 hostAttributes: metadata.hostAttributes,
232 providers: metadata.providers,
233 viewProviders: metadata.viewProviders,
234 queries: metadata.queries,
235 guards: metadata.guards,
236 viewQueries: metadata.viewQueries,
237 entryComponents: metadata.entryComponents,
238 componentViewType: metadata.componentViewType,
239 rendererType: metadata.rendererType,
240 componentFactory: metadata.componentFactory,
241 template: templateMetadata
242 });
243 if (templateMetadata) {
244 _this.initComponentFactory(metadata.componentFactory, templateMetadata.ngContentSelectors);
245 }
246 _this._directiveCache.set(directiveType, normalizedDirMeta);
247 _this._summaryCache.set(directiveType, normalizedDirMeta.toSummary());
248 return null;
249 };
250 if (metadata.isComponent) {
251 var template = metadata.template;
252 var templateMeta = this._directiveNormalizer.normalizeTemplate({
253 ngModuleType: ngModuleType,
254 componentType: directiveType,
255 moduleUrl: this._reflector.componentModuleUrl(directiveType, annotation),
256 encapsulation: template.encapsulation,
257 template: template.template,
258 templateUrl: template.templateUrl,
259 styles: template.styles,
260 styleUrls: template.styleUrls,
261 animations: template.animations,
262 interpolation: template.interpolation,
263 preserveWhitespaces: template.preserveWhitespaces
264 });
265 if (util_2.isPromise(templateMeta) && isSync) {
266 this._reportError(componentStillLoadingError(directiveType), directiveType);
267 return null;
268 }
269 return util_2.SyncAsync.then(templateMeta, createDirectiveMetadata);
270 }
271 else {
272 // directive
273 createDirectiveMetadata(null);
274 return null;
275 }
276 };
277 CompileMetadataResolver.prototype.getNonNormalizedDirectiveMetadata = function (directiveType) {
278 var _this = this;
279 directiveType = util_2.resolveForwardRef(directiveType);
280 if (!directiveType) {
281 return null;
282 }
283 var cacheEntry = this._nonNormalizedDirectiveCache.get(directiveType);
284 if (cacheEntry) {
285 return cacheEntry;
286 }
287 var dirMeta = this._directiveResolver.resolve(directiveType, false);
288 if (!dirMeta) {
289 return null;
290 }
291 var nonNormalizedTemplateMetadata = undefined;
292 if (core_1.createComponent.isTypeOf(dirMeta)) {
293 // component
294 var compMeta = dirMeta;
295 assertions_1.assertArrayOfStrings('styles', compMeta.styles);
296 assertions_1.assertArrayOfStrings('styleUrls', compMeta.styleUrls);
297 assertions_1.assertInterpolationSymbols('interpolation', compMeta.interpolation);
298 var animations = compMeta.animations;
299 nonNormalizedTemplateMetadata = new cpl.CompileTemplateMetadata({
300 encapsulation: util_2.noUndefined(compMeta.encapsulation),
301 template: util_2.noUndefined(compMeta.template),
302 templateUrl: util_2.noUndefined(compMeta.templateUrl),
303 htmlAst: null,
304 styles: compMeta.styles || [],
305 styleUrls: compMeta.styleUrls || [],
306 animations: animations || [],
307 interpolation: util_2.noUndefined(compMeta.interpolation),
308 isInline: !!compMeta.template,
309 externalStylesheets: [],
310 ngContentSelectors: [],
311 preserveWhitespaces: util_2.noUndefined(dirMeta.preserveWhitespaces),
312 });
313 }
314 var changeDetectionStrategy = null;
315 var viewProviders = [];
316 var entryComponentMetadata = [];
317 var selector = dirMeta.selector;
318 if (core_1.createComponent.isTypeOf(dirMeta)) {
319 // Component
320 var compMeta = dirMeta;
321 changeDetectionStrategy = compMeta.changeDetection;
322 if (compMeta.viewProviders) {
323 viewProviders = this._getProvidersMetadata(compMeta.viewProviders, entryComponentMetadata, "viewProviders for \"" + stringifyType(directiveType) + "\"", [], directiveType);
324 }
325 if (compMeta.entryComponents) {
326 entryComponentMetadata = flattenAndDedupeArray(compMeta.entryComponents)
327 .map(function (type) { return _this._getEntryComponentMetadata(type); })
328 .concat(entryComponentMetadata);
329 }
330 if (!selector) {
331 selector = this._schemaRegistry.getDefaultComponentElementName();
332 }
333 }
334 else {
335 // Directive
336 if (!selector) {
337 selector = null;
338 }
339 }
340 var providers = [];
341 if (dirMeta.providers != null) {
342 providers = this._getProvidersMetadata(dirMeta.providers, entryComponentMetadata, "providers for \"" + stringifyType(directiveType) + "\"", [], directiveType);
343 }
344 var queries = [];
345 var viewQueries = [];
346 if (dirMeta.queries != null) {
347 queries = this._getQueriesMetadata(dirMeta.queries, false, directiveType);
348 viewQueries = this._getQueriesMetadata(dirMeta.queries, true, directiveType);
349 }
350 var metadata = cpl.CompileDirectiveMetadata.create({
351 isHost: false,
352 selector: selector,
353 exportAs: util_2.noUndefined(dirMeta.exportAs),
354 isComponent: !!nonNormalizedTemplateMetadata,
355 type: this._getTypeMetadata(directiveType),
356 template: nonNormalizedTemplateMetadata,
357 changeDetection: changeDetectionStrategy,
358 inputs: dirMeta.inputs || [],
359 outputs: dirMeta.outputs || [],
360 host: dirMeta.host || {},
361 providers: providers || [],
362 viewProviders: viewProviders || [],
363 queries: queries || [],
364 guards: dirMeta.guards || {},
365 viewQueries: viewQueries || [],
366 entryComponents: entryComponentMetadata,
367 componentViewType: nonNormalizedTemplateMetadata ? this.getComponentViewClass(directiveType) :
368 null,
369 rendererType: nonNormalizedTemplateMetadata ? this.getRendererType(directiveType) : null,
370 componentFactory: null
371 });
372 if (nonNormalizedTemplateMetadata) {
373 metadata.componentFactory =
374 this.getComponentFactory(selector, directiveType, metadata.inputs, metadata.outputs);
375 }
376 cacheEntry = { metadata: metadata, annotation: dirMeta };
377 this._nonNormalizedDirectiveCache.set(directiveType, cacheEntry);
378 return cacheEntry;
379 };
380 /**
381 * Gets the metadata for the given directive.
382 * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
383 */
384 CompileMetadataResolver.prototype.getDirectiveMetadata = function (directiveType) {
385 var dirMeta = this._directiveCache.get(directiveType);
386 if (!dirMeta) {
387 this._reportError(parse_util_1.syntaxError("Illegal state: getDirectiveMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Directive " + stringifyType(directiveType) + "."), directiveType);
388 }
389 return dirMeta;
390 };
391 CompileMetadataResolver.prototype.getDirectiveSummary = function (dirType) {
392 var dirSummary = this._loadSummary(dirType, cpl.CompileSummaryKind.Directive);
393 if (!dirSummary) {
394 this._reportError(parse_util_1.syntaxError("Illegal state: Could not load the summary for directive " + stringifyType(dirType) + "."), dirType);
395 }
396 return dirSummary;
397 };
398 CompileMetadataResolver.prototype.isDirective = function (type) {
399 return !!this._loadSummary(type, cpl.CompileSummaryKind.Directive) ||
400 this._directiveResolver.isDirective(type);
401 };
402 CompileMetadataResolver.prototype.isAbstractDirective = function (type) {
403 var summary = this._loadSummary(type, cpl.CompileSummaryKind.Directive);
404 if (summary && !summary.isComponent) {
405 return !summary.selector;
406 }
407 var meta = this._directiveResolver.resolve(type, false);
408 if (meta && !core_1.createComponent.isTypeOf(meta)) {
409 return !meta.selector;
410 }
411 return false;
412 };
413 CompileMetadataResolver.prototype.isPipe = function (type) {
414 return !!this._loadSummary(type, cpl.CompileSummaryKind.Pipe) ||
415 this._pipeResolver.isPipe(type);
416 };
417 CompileMetadataResolver.prototype.isNgModule = function (type) {
418 return !!this._loadSummary(type, cpl.CompileSummaryKind.NgModule) ||
419 this._ngModuleResolver.isNgModule(type);
420 };
421 CompileMetadataResolver.prototype.getNgModuleSummary = function (moduleType, alreadyCollecting) {
422 if (alreadyCollecting === void 0) { alreadyCollecting = null; }
423 var moduleSummary = this._loadSummary(moduleType, cpl.CompileSummaryKind.NgModule);
424 if (!moduleSummary) {
425 var moduleMeta = this.getNgModuleMetadata(moduleType, false, alreadyCollecting);
426 moduleSummary = moduleMeta ? moduleMeta.toSummary() : null;
427 if (moduleSummary) {
428 this._summaryCache.set(moduleType, moduleSummary);
429 }
430 }
431 return moduleSummary;
432 };
433 /**
434 * Loads the declared directives and pipes of an NgModule.
435 */
436 CompileMetadataResolver.prototype.loadNgModuleDirectiveAndPipeMetadata = function (moduleType, isSync, throwIfNotFound) {
437 var _this = this;
438 if (throwIfNotFound === void 0) { throwIfNotFound = true; }
439 var ngModule = this.getNgModuleMetadata(moduleType, throwIfNotFound);
440 var loading = [];
441 if (ngModule) {
442 ngModule.declaredDirectives.forEach(function (id) {
443 var promise = _this.loadDirectiveMetadata(moduleType, id.reference, isSync);
444 if (promise) {
445 loading.push(promise);
446 }
447 });
448 ngModule.declaredPipes.forEach(function (id) { return _this._loadPipeMetadata(id.reference); });
449 }
450 return Promise.all(loading);
451 };
452 CompileMetadataResolver.prototype.getShallowModuleMetadata = function (moduleType) {
453 var compileMeta = this._shallowModuleCache.get(moduleType);
454 if (compileMeta) {
455 return compileMeta;
456 }
457 var ngModuleMeta = directive_resolver_1.findLast(this._reflector.shallowAnnotations(moduleType), core_1.createNgModule.isTypeOf);
458 compileMeta = {
459 type: this._getTypeMetadata(moduleType),
460 rawExports: ngModuleMeta.exports,
461 rawImports: ngModuleMeta.imports,
462 rawProviders: ngModuleMeta.providers,
463 };
464 this._shallowModuleCache.set(moduleType, compileMeta);
465 return compileMeta;
466 };
467 CompileMetadataResolver.prototype.getNgModuleMetadata = function (moduleType, throwIfNotFound, alreadyCollecting) {
468 var _this = this;
469 if (throwIfNotFound === void 0) { throwIfNotFound = true; }
470 if (alreadyCollecting === void 0) { alreadyCollecting = null; }
471 moduleType = util_2.resolveForwardRef(moduleType);
472 var compileMeta = this._ngModuleCache.get(moduleType);
473 if (compileMeta) {
474 return compileMeta;
475 }
476 var meta = this._ngModuleResolver.resolve(moduleType, throwIfNotFound);
477 if (!meta) {
478 return null;
479 }
480 var declaredDirectives = [];
481 var exportedNonModuleIdentifiers = [];
482 var declaredPipes = [];
483 var importedModules = [];
484 var exportedModules = [];
485 var providers = [];
486 var entryComponents = [];
487 var bootstrapComponents = [];
488 var schemas = [];
489 if (meta.imports) {
490 flattenAndDedupeArray(meta.imports).forEach(function (importedType) {
491 var importedModuleType = undefined;
492 if (isValidType(importedType)) {
493 importedModuleType = importedType;
494 }
495 else if (importedType && importedType.ngModule) {
496 var moduleWithProviders = importedType;
497 importedModuleType = moduleWithProviders.ngModule;
498 if (moduleWithProviders.providers) {
499 providers.push.apply(providers, tslib_1.__spreadArray([], tslib_1.__read(_this._getProvidersMetadata(moduleWithProviders.providers, entryComponents, "provider for the NgModule '" + stringifyType(importedModuleType) + "'", [], importedType))));
500 }
501 }
502 if (importedModuleType) {
503 if (_this._checkSelfImport(moduleType, importedModuleType))
504 return;
505 if (!alreadyCollecting)
506 alreadyCollecting = new Set();
507 if (alreadyCollecting.has(importedModuleType)) {
508 _this._reportError(parse_util_1.syntaxError(_this._getTypeDescriptor(importedModuleType) + " '" + stringifyType(importedType) + "' is imported recursively by the module '" + stringifyType(moduleType) + "'."), moduleType);
509 return;
510 }
511 alreadyCollecting.add(importedModuleType);
512 var importedModuleSummary = _this.getNgModuleSummary(importedModuleType, alreadyCollecting);
513 alreadyCollecting.delete(importedModuleType);
514 if (!importedModuleSummary) {
515 var err = parse_util_1.syntaxError("Unexpected " + _this._getTypeDescriptor(importedType) + " '" + stringifyType(importedType) + "' imported by the module '" + stringifyType(moduleType) + "'. Please add a @NgModule annotation.");
516 // If possible, record additional context for this error to enable more useful
517 // diagnostics on the compiler side.
518 if (importedType instanceof static_symbol_1.StaticSymbol) {
519 err[MISSING_NG_MODULE_METADATA_ERROR_DATA] = {
520 fileName: importedType.filePath,
521 className: importedType.name,
522 };
523 }
524 _this._reportError(err, moduleType);
525 return;
526 }
527 importedModules.push(importedModuleSummary);
528 }
529 else {
530 _this._reportError(parse_util_1.syntaxError("Unexpected value '" + stringifyType(importedType) + "' imported by the module '" + stringifyType(moduleType) + "'"), moduleType);
531 return;
532 }
533 });
534 }
535 if (meta.exports) {
536 flattenAndDedupeArray(meta.exports).forEach(function (exportedType) {
537 if (!isValidType(exportedType)) {
538 _this._reportError(parse_util_1.syntaxError("Unexpected value '" + stringifyType(exportedType) + "' exported by the module '" + stringifyType(moduleType) + "'"), moduleType);
539 return;
540 }
541 if (!alreadyCollecting)
542 alreadyCollecting = new Set();
543 if (alreadyCollecting.has(exportedType)) {
544 _this._reportError(parse_util_1.syntaxError(_this._getTypeDescriptor(exportedType) + " '" + util_2.stringify(exportedType) + "' is exported recursively by the module '" + stringifyType(moduleType) + "'"), moduleType);
545 return;
546 }
547 alreadyCollecting.add(exportedType);
548 var exportedModuleSummary = _this.getNgModuleSummary(exportedType, alreadyCollecting);
549 alreadyCollecting.delete(exportedType);
550 if (exportedModuleSummary) {
551 exportedModules.push(exportedModuleSummary);
552 }
553 else {
554 exportedNonModuleIdentifiers.push(_this._getIdentifierMetadata(exportedType));
555 }
556 });
557 }
558 // Note: This will be modified later, so we rely on
559 // getting a new instance every time!
560 var transitiveModule = this._getTransitiveNgModuleMetadata(importedModules, exportedModules);
561 if (meta.declarations) {
562 flattenAndDedupeArray(meta.declarations).forEach(function (declaredType) {
563 if (!isValidType(declaredType)) {
564 _this._reportError(parse_util_1.syntaxError("Unexpected value '" + stringifyType(declaredType) + "' declared by the module '" + stringifyType(moduleType) + "'"), moduleType);
565 return;
566 }
567 var declaredIdentifier = _this._getIdentifierMetadata(declaredType);
568 if (_this.isDirective(declaredType)) {
569 if (_this.isAbstractDirective(declaredType)) {
570 _this._reportError(parse_util_1.syntaxError("Directive " + stringifyType(declaredType) + " has no selector, please add it!"), declaredType);
571 }
572 transitiveModule.addDirective(declaredIdentifier);
573 declaredDirectives.push(declaredIdentifier);
574 _this._addTypeToModule(declaredType, moduleType);
575 }
576 else if (_this.isPipe(declaredType)) {
577 transitiveModule.addPipe(declaredIdentifier);
578 transitiveModule.pipes.push(declaredIdentifier);
579 declaredPipes.push(declaredIdentifier);
580 _this._addTypeToModule(declaredType, moduleType);
581 }
582 else {
583 _this._reportError(parse_util_1.syntaxError("Unexpected " + _this._getTypeDescriptor(declaredType) + " '" + stringifyType(declaredType) + "' declared by the module '" + stringifyType(moduleType) + "'. Please add a @Pipe/@Directive/@Component annotation."), moduleType);
584 return;
585 }
586 });
587 }
588 var exportedDirectives = [];
589 var exportedPipes = [];
590 exportedNonModuleIdentifiers.forEach(function (exportedId) {
591 if (transitiveModule.directivesSet.has(exportedId.reference)) {
592 exportedDirectives.push(exportedId);
593 transitiveModule.addExportedDirective(exportedId);
594 }
595 else if (transitiveModule.pipesSet.has(exportedId.reference)) {
596 exportedPipes.push(exportedId);
597 transitiveModule.addExportedPipe(exportedId);
598 }
599 else {
600 _this._reportError(parse_util_1.syntaxError("Can't export " + _this._getTypeDescriptor(exportedId.reference) + " " + stringifyType(exportedId.reference) + " from " + stringifyType(moduleType) + " as it was neither declared nor imported!"), moduleType);
601 return;
602 }
603 });
604 // The providers of the module have to go last
605 // so that they overwrite any other provider we already added.
606 if (meta.providers) {
607 providers.push.apply(providers, tslib_1.__spreadArray([], tslib_1.__read(this._getProvidersMetadata(meta.providers, entryComponents, "provider for the NgModule '" + stringifyType(moduleType) + "'", [], moduleType))));
608 }
609 if (meta.entryComponents) {
610 entryComponents.push.apply(entryComponents, tslib_1.__spreadArray([], tslib_1.__read(flattenAndDedupeArray(meta.entryComponents)
611 .map(function (type) { return _this._getEntryComponentMetadata(type); }))));
612 }
613 if (meta.bootstrap) {
614 flattenAndDedupeArray(meta.bootstrap).forEach(function (type) {
615 if (!isValidType(type)) {
616 _this._reportError(parse_util_1.syntaxError("Unexpected value '" + stringifyType(type) + "' used in the bootstrap property of module '" + stringifyType(moduleType) + "'"), moduleType);
617 return;
618 }
619 bootstrapComponents.push(_this._getIdentifierMetadata(type));
620 });
621 }
622 entryComponents.push.apply(entryComponents, tslib_1.__spreadArray([], tslib_1.__read(bootstrapComponents.map(function (type) { return _this._getEntryComponentMetadata(type.reference); }))));
623 if (meta.schemas) {
624 schemas.push.apply(schemas, tslib_1.__spreadArray([], tslib_1.__read(flattenAndDedupeArray(meta.schemas))));
625 }
626 compileMeta = new cpl.CompileNgModuleMetadata({
627 type: this._getTypeMetadata(moduleType),
628 providers: providers,
629 entryComponents: entryComponents,
630 bootstrapComponents: bootstrapComponents,
631 schemas: schemas,
632 declaredDirectives: declaredDirectives,
633 exportedDirectives: exportedDirectives,
634 declaredPipes: declaredPipes,
635 exportedPipes: exportedPipes,
636 importedModules: importedModules,
637 exportedModules: exportedModules,
638 transitiveModule: transitiveModule,
639 id: meta.id || null,
640 });
641 entryComponents.forEach(function (id) { return transitiveModule.addEntryComponent(id); });
642 providers.forEach(function (provider) { return transitiveModule.addProvider(provider, compileMeta.type); });
643 transitiveModule.addModule(compileMeta.type);
644 this._ngModuleCache.set(moduleType, compileMeta);
645 return compileMeta;
646 };
647 CompileMetadataResolver.prototype._checkSelfImport = function (moduleType, importedModuleType) {
648 if (moduleType === importedModuleType) {
649 this._reportError(parse_util_1.syntaxError("'" + stringifyType(moduleType) + "' module can't import itself"), moduleType);
650 return true;
651 }
652 return false;
653 };
654 CompileMetadataResolver.prototype._getTypeDescriptor = function (type) {
655 if (isValidType(type)) {
656 if (this.isDirective(type)) {
657 return 'directive';
658 }
659 if (this.isPipe(type)) {
660 return 'pipe';
661 }
662 if (this.isNgModule(type)) {
663 return 'module';
664 }
665 }
666 if (type.provide) {
667 return 'provider';
668 }
669 return 'value';
670 };
671 CompileMetadataResolver.prototype._addTypeToModule = function (type, moduleType) {
672 var oldModule = this._ngModuleOfTypes.get(type);
673 if (oldModule && oldModule !== moduleType) {
674 this._reportError(parse_util_1.syntaxError("Type " + stringifyType(type) + " is part of the declarations of 2 modules: " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + "! " +
675 ("Please consider moving " + stringifyType(type) + " to a higher module that imports " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + ". ") +
676 ("You can also create a new NgModule that exports and includes " + stringifyType(type) + " then import that NgModule in " + stringifyType(oldModule) + " and " + stringifyType(moduleType) + ".")), moduleType);
677 return;
678 }
679 this._ngModuleOfTypes.set(type, moduleType);
680 };
681 CompileMetadataResolver.prototype._getTransitiveNgModuleMetadata = function (importedModules, exportedModules) {
682 // collect `providers` / `entryComponents` from all imported and all exported modules
683 var result = new cpl.TransitiveCompileNgModuleMetadata();
684 var modulesByToken = new Map();
685 importedModules.concat(exportedModules).forEach(function (modSummary) {
686 modSummary.modules.forEach(function (mod) { return result.addModule(mod); });
687 modSummary.entryComponents.forEach(function (comp) { return result.addEntryComponent(comp); });
688 var addedTokens = new Set();
689 modSummary.providers.forEach(function (entry) {
690 var tokenRef = cpl.tokenReference(entry.provider.token);
691 var prevModules = modulesByToken.get(tokenRef);
692 if (!prevModules) {
693 prevModules = new Set();
694 modulesByToken.set(tokenRef, prevModules);
695 }
696 var moduleRef = entry.module.reference;
697 // Note: the providers of one module may still contain multiple providers
698 // per token (e.g. for multi providers), and we need to preserve these.
699 if (addedTokens.has(tokenRef) || !prevModules.has(moduleRef)) {
700 prevModules.add(moduleRef);
701 addedTokens.add(tokenRef);
702 result.addProvider(entry.provider, entry.module);
703 }
704 });
705 });
706 exportedModules.forEach(function (modSummary) {
707 modSummary.exportedDirectives.forEach(function (id) { return result.addExportedDirective(id); });
708 modSummary.exportedPipes.forEach(function (id) { return result.addExportedPipe(id); });
709 });
710 importedModules.forEach(function (modSummary) {
711 modSummary.exportedDirectives.forEach(function (id) { return result.addDirective(id); });
712 modSummary.exportedPipes.forEach(function (id) { return result.addPipe(id); });
713 });
714 return result;
715 };
716 CompileMetadataResolver.prototype._getIdentifierMetadata = function (type) {
717 type = util_2.resolveForwardRef(type);
718 return { reference: type };
719 };
720 CompileMetadataResolver.prototype.isInjectable = function (type) {
721 var annotations = this._reflector.tryAnnotations(type);
722 return annotations.some(function (ann) { return core_1.createInjectable.isTypeOf(ann); });
723 };
724 CompileMetadataResolver.prototype.getInjectableSummary = function (type) {
725 return {
726 summaryKind: cpl.CompileSummaryKind.Injectable,
727 type: this._getTypeMetadata(type, null, false)
728 };
729 };
730 CompileMetadataResolver.prototype.getInjectableMetadata = function (type, dependencies, throwOnUnknownDeps) {
731 if (dependencies === void 0) { dependencies = null; }
732 if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }
733 var typeSummary = this._loadSummary(type, cpl.CompileSummaryKind.Injectable);
734 var typeMetadata = typeSummary ?
735 typeSummary.type :
736 this._getTypeMetadata(type, dependencies, throwOnUnknownDeps);
737 var annotations = this._reflector.annotations(type).filter(function (ann) { return core_1.createInjectable.isTypeOf(ann); });
738 if (annotations.length === 0) {
739 return null;
740 }
741 var meta = annotations[annotations.length - 1];
742 return {
743 symbol: type,
744 type: typeMetadata,
745 providedIn: meta.providedIn,
746 useValue: meta.useValue,
747 useClass: meta.useClass,
748 useExisting: meta.useExisting,
749 useFactory: meta.useFactory,
750 deps: meta.deps,
751 };
752 };
753 CompileMetadataResolver.prototype._getTypeMetadata = function (type, dependencies, throwOnUnknownDeps) {
754 if (dependencies === void 0) { dependencies = null; }
755 if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }
756 var identifier = this._getIdentifierMetadata(type);
757 return {
758 reference: identifier.reference,
759 diDeps: this._getDependenciesMetadata(identifier.reference, dependencies, throwOnUnknownDeps),
760 lifecycleHooks: lifecycle_reflector_1.getAllLifecycleHooks(this._reflector, identifier.reference),
761 };
762 };
763 CompileMetadataResolver.prototype._getFactoryMetadata = function (factory, dependencies) {
764 if (dependencies === void 0) { dependencies = null; }
765 factory = util_2.resolveForwardRef(factory);
766 return { reference: factory, diDeps: this._getDependenciesMetadata(factory, dependencies) };
767 };
768 /**
769 * Gets the metadata for the given pipe.
770 * This assumes `loadNgModuleDirectiveAndPipeMetadata` has been called first.
771 */
772 CompileMetadataResolver.prototype.getPipeMetadata = function (pipeType) {
773 var pipeMeta = this._pipeCache.get(pipeType);
774 if (!pipeMeta) {
775 this._reportError(parse_util_1.syntaxError("Illegal state: getPipeMetadata can only be called after loadNgModuleDirectiveAndPipeMetadata for a module that declares it. Pipe " + stringifyType(pipeType) + "."), pipeType);
776 }
777 return pipeMeta || null;
778 };
779 CompileMetadataResolver.prototype.getPipeSummary = function (pipeType) {
780 var pipeSummary = this._loadSummary(pipeType, cpl.CompileSummaryKind.Pipe);
781 if (!pipeSummary) {
782 this._reportError(parse_util_1.syntaxError("Illegal state: Could not load the summary for pipe " + stringifyType(pipeType) + "."), pipeType);
783 }
784 return pipeSummary;
785 };
786 CompileMetadataResolver.prototype.getOrLoadPipeMetadata = function (pipeType) {
787 var pipeMeta = this._pipeCache.get(pipeType);
788 if (!pipeMeta) {
789 pipeMeta = this._loadPipeMetadata(pipeType);
790 }
791 return pipeMeta;
792 };
793 CompileMetadataResolver.prototype._loadPipeMetadata = function (pipeType) {
794 pipeType = util_2.resolveForwardRef(pipeType);
795 var pipeAnnotation = this._pipeResolver.resolve(pipeType);
796 var pipeMeta = new cpl.CompilePipeMetadata({
797 type: this._getTypeMetadata(pipeType),
798 name: pipeAnnotation.name,
799 pure: !!pipeAnnotation.pure
800 });
801 this._pipeCache.set(pipeType, pipeMeta);
802 this._summaryCache.set(pipeType, pipeMeta.toSummary());
803 return pipeMeta;
804 };
805 CompileMetadataResolver.prototype._getDependenciesMetadata = function (typeOrFunc, dependencies, throwOnUnknownDeps) {
806 var _this = this;
807 if (throwOnUnknownDeps === void 0) { throwOnUnknownDeps = true; }
808 var hasUnknownDeps = false;
809 var params = dependencies || this._reflector.parameters(typeOrFunc) || [];
810 var dependenciesMetadata = params.map(function (param) {
811 var isAttribute = false;
812 var isHost = false;
813 var isSelf = false;
814 var isSkipSelf = false;
815 var isOptional = false;
816 var token = null;
817 if (Array.isArray(param)) {
818 param.forEach(function (paramEntry) {
819 if (core_1.createHost.isTypeOf(paramEntry)) {
820 isHost = true;
821 }
822 else if (core_1.createSelf.isTypeOf(paramEntry)) {
823 isSelf = true;
824 }
825 else if (core_1.createSkipSelf.isTypeOf(paramEntry)) {
826 isSkipSelf = true;
827 }
828 else if (core_1.createOptional.isTypeOf(paramEntry)) {
829 isOptional = true;
830 }
831 else if (core_1.createAttribute.isTypeOf(paramEntry)) {
832 isAttribute = true;
833 token = paramEntry.attributeName;
834 }
835 else if (core_1.createInject.isTypeOf(paramEntry)) {
836 token = paramEntry.token;
837 }
838 else if (core_1.createInjectionToken.isTypeOf(paramEntry) ||
839 paramEntry instanceof static_symbol_1.StaticSymbol) {
840 token = paramEntry;
841 }
842 else if (isValidType(paramEntry) && token == null) {
843 token = paramEntry;
844 }
845 });
846 }
847 else {
848 token = param;
849 }
850 if (token == null) {
851 hasUnknownDeps = true;
852 return {};
853 }
854 return {
855 isAttribute: isAttribute,
856 isHost: isHost,
857 isSelf: isSelf,
858 isSkipSelf: isSkipSelf,
859 isOptional: isOptional,
860 token: _this._getTokenMetadata(token)
861 };
862 });
863 if (hasUnknownDeps) {
864 var depsTokens = dependenciesMetadata.map(function (dep) { return dep.token ? stringifyType(dep.token) : '?'; }).join(', ');
865 var message = "Can't resolve all parameters for " + stringifyType(typeOrFunc) + ": (" + depsTokens + ").";
866 if (throwOnUnknownDeps || this._config.strictInjectionParameters) {
867 this._reportError(parse_util_1.syntaxError(message), typeOrFunc);
868 }
869 }
870 return dependenciesMetadata;
871 };
872 CompileMetadataResolver.prototype._getTokenMetadata = function (token) {
873 token = util_2.resolveForwardRef(token);
874 var compileToken;
875 if (typeof token === 'string') {
876 compileToken = { value: token };
877 }
878 else {
879 compileToken = { identifier: { reference: token } };
880 }
881 return compileToken;
882 };
883 CompileMetadataResolver.prototype._getProvidersMetadata = function (providers, targetEntryComponents, debugInfo, compileProviders, type) {
884 var _this = this;
885 if (compileProviders === void 0) { compileProviders = []; }
886 providers.forEach(function (provider, providerIdx) {
887 if (Array.isArray(provider)) {
888 _this._getProvidersMetadata(provider, targetEntryComponents, debugInfo, compileProviders);
889 }
890 else {
891 provider = util_2.resolveForwardRef(provider);
892 var providerMeta = undefined;
893 if (provider && typeof provider === 'object' && provider.hasOwnProperty('provide')) {
894 _this._validateProvider(provider);
895 providerMeta = new cpl.ProviderMeta(provider.provide, provider);
896 }
897 else if (isValidType(provider)) {
898 providerMeta = new cpl.ProviderMeta(provider, { useClass: provider });
899 }
900 else if (provider === void 0) {
901 _this._reportError(parse_util_1.syntaxError("Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files."));
902 return;
903 }
904 else {
905 var providersInfo = providers
906 .reduce(function (soFar, seenProvider, seenProviderIdx) {
907 if (seenProviderIdx < providerIdx) {
908 soFar.push("" + stringifyType(seenProvider));
909 }
910 else if (seenProviderIdx == providerIdx) {
911 soFar.push("?" + stringifyType(seenProvider) + "?");
912 }
913 else if (seenProviderIdx == providerIdx + 1) {
914 soFar.push('...');
915 }
916 return soFar;
917 }, [])
918 .join(', ');
919 _this._reportError(parse_util_1.syntaxError("Invalid " + (debugInfo ?
920 debugInfo :
921 'provider') + " - only instances of Provider and Type are allowed, got: [" + providersInfo + "]"), type);
922 return;
923 }
924 if (providerMeta.token ===
925 _this._reflector.resolveExternalReference(identifiers_1.Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS)) {
926 targetEntryComponents.push.apply(targetEntryComponents, tslib_1.__spreadArray([], tslib_1.__read(_this._getEntryComponentsFromProvider(providerMeta, type))));
927 }
928 else {
929 compileProviders.push(_this.getProviderMetadata(providerMeta));
930 }
931 }
932 });
933 return compileProviders;
934 };
935 CompileMetadataResolver.prototype._validateProvider = function (provider) {
936 if (provider.hasOwnProperty('useClass') && provider.useClass == null) {
937 this._reportError(parse_util_1.syntaxError("Invalid provider for " + stringifyType(provider.provide) + ". useClass cannot be " + provider.useClass + ".\n Usually it happens when:\n 1. There's a circular dependency (might be caused by using index.ts (barrel) files).\n 2. Class was used before it was declared. Use forwardRef in this case."));
938 }
939 };
940 CompileMetadataResolver.prototype._getEntryComponentsFromProvider = function (provider, type) {
941 var _this = this;
942 var components = [];
943 var collectedIdentifiers = [];
944 if (provider.useFactory || provider.useExisting || provider.useClass) {
945 this._reportError(parse_util_1.syntaxError("The ANALYZE_FOR_ENTRY_COMPONENTS token only supports useValue!"), type);
946 return [];
947 }
948 if (!provider.multi) {
949 this._reportError(parse_util_1.syntaxError("The ANALYZE_FOR_ENTRY_COMPONENTS token only supports 'multi = true'!"), type);
950 return [];
951 }
952 extractIdentifiers(provider.useValue, collectedIdentifiers);
953 collectedIdentifiers.forEach(function (identifier) {
954 var entry = _this._getEntryComponentMetadata(identifier.reference, false);
955 if (entry) {
956 components.push(entry);
957 }
958 });
959 return components;
960 };
961 CompileMetadataResolver.prototype._getEntryComponentMetadata = function (dirType, throwIfNotFound) {
962 if (throwIfNotFound === void 0) { throwIfNotFound = true; }
963 var dirMeta = this.getNonNormalizedDirectiveMetadata(dirType);
964 if (dirMeta && dirMeta.metadata.isComponent) {
965 return { componentType: dirType, componentFactory: dirMeta.metadata.componentFactory };
966 }
967 var dirSummary = this._loadSummary(dirType, cpl.CompileSummaryKind.Directive);
968 if (dirSummary && dirSummary.isComponent) {
969 return { componentType: dirType, componentFactory: dirSummary.componentFactory };
970 }
971 if (throwIfNotFound) {
972 throw parse_util_1.syntaxError(dirType.name + " cannot be used as an entry component.");
973 }
974 return null;
975 };
976 CompileMetadataResolver.prototype._getInjectableTypeMetadata = function (type, dependencies) {
977 if (dependencies === void 0) { dependencies = null; }
978 var typeSummary = this._loadSummary(type, cpl.CompileSummaryKind.Injectable);
979 if (typeSummary) {
980 return typeSummary.type;
981 }
982 return this._getTypeMetadata(type, dependencies);
983 };
984 CompileMetadataResolver.prototype.getProviderMetadata = function (provider) {
985 var compileDeps = undefined;
986 var compileTypeMetadata = null;
987 var compileFactoryMetadata = null;
988 var token = this._getTokenMetadata(provider.token);
989 if (provider.useClass) {
990 compileTypeMetadata =
991 this._getInjectableTypeMetadata(provider.useClass, provider.dependencies);
992 compileDeps = compileTypeMetadata.diDeps;
993 if (provider.token === provider.useClass) {
994 // use the compileTypeMetadata as it contains information about lifecycleHooks...
995 token = { identifier: compileTypeMetadata };
996 }
997 }
998 else if (provider.useFactory) {
999 compileFactoryMetadata = this._getFactoryMetadata(provider.useFactory, provider.dependencies);
1000 compileDeps = compileFactoryMetadata.diDeps;
1001 }
1002 return {
1003 token: token,
1004 useClass: compileTypeMetadata,
1005 useValue: provider.useValue,
1006 useFactory: compileFactoryMetadata,
1007 useExisting: provider.useExisting ? this._getTokenMetadata(provider.useExisting) : undefined,
1008 deps: compileDeps,
1009 multi: provider.multi
1010 };
1011 };
1012 CompileMetadataResolver.prototype._getQueriesMetadata = function (queries, isViewQuery, directiveType) {
1013 var _this = this;
1014 var res = [];
1015 Object.keys(queries).forEach(function (propertyName) {
1016 var query = queries[propertyName];
1017 if (query.isViewQuery === isViewQuery) {
1018 res.push(_this._getQueryMetadata(query, propertyName, directiveType));
1019 }
1020 });
1021 return res;
1022 };
1023 CompileMetadataResolver.prototype._queryVarBindings = function (selector) {
1024 return selector.split(/\s*,\s*/);
1025 };
1026 CompileMetadataResolver.prototype._getQueryMetadata = function (q, propertyName, typeOrFunc) {
1027 var _this = this;
1028 var selectors;
1029 if (typeof q.selector === 'string') {
1030 selectors =
1031 this._queryVarBindings(q.selector).map(function (varName) { return _this._getTokenMetadata(varName); });
1032 }
1033 else {
1034 if (!q.selector) {
1035 this._reportError(parse_util_1.syntaxError("Can't construct a query for the property \"" + propertyName + "\" of \"" + stringifyType(typeOrFunc) + "\" since the query selector wasn't defined."), typeOrFunc);
1036 selectors = [];
1037 }
1038 else {
1039 selectors = [this._getTokenMetadata(q.selector)];
1040 }
1041 }
1042 return {
1043 selectors: selectors,
1044 first: q.first,
1045 descendants: q.descendants,
1046 emitDistinctChangesOnly: q.emitDistinctChangesOnly,
1047 propertyName: propertyName,
1048 read: q.read ? this._getTokenMetadata(q.read) : null,
1049 static: q.static
1050 };
1051 };
1052 CompileMetadataResolver.prototype._reportError = function (error, type, otherType) {
1053 if (this._errorCollector) {
1054 this._errorCollector(error, type);
1055 if (otherType) {
1056 this._errorCollector(error, otherType);
1057 }
1058 }
1059 else {
1060 throw error;
1061 }
1062 };
1063 return CompileMetadataResolver;
1064 }());
1065 exports.CompileMetadataResolver = CompileMetadataResolver;
1066 function flattenArray(tree, out) {
1067 if (out === void 0) { out = []; }
1068 if (tree) {
1069 for (var i = 0; i < tree.length; i++) {
1070 var item = util_2.resolveForwardRef(tree[i]);
1071 if (Array.isArray(item)) {
1072 flattenArray(item, out);
1073 }
1074 else {
1075 out.push(item);
1076 }
1077 }
1078 }
1079 return out;
1080 }
1081 function dedupeArray(array) {
1082 if (array) {
1083 return Array.from(new Set(array));
1084 }
1085 return [];
1086 }
1087 function flattenAndDedupeArray(tree) {
1088 return dedupeArray(flattenArray(tree));
1089 }
1090 function isValidType(value) {
1091 return (value instanceof static_symbol_1.StaticSymbol) || (value instanceof core_1.Type);
1092 }
1093 function extractIdentifiers(value, targetIdentifiers) {
1094 util_2.visitValue(value, new _CompileValueConverter(), targetIdentifiers);
1095 }
1096 var _CompileValueConverter = /** @class */ (function (_super) {
1097 tslib_1.__extends(_CompileValueConverter, _super);
1098 function _CompileValueConverter() {
1099 return _super !== null && _super.apply(this, arguments) || this;
1100 }
1101 _CompileValueConverter.prototype.visitOther = function (value, targetIdentifiers) {
1102 targetIdentifiers.push({ reference: value });
1103 };
1104 return _CompileValueConverter;
1105 }(util_2.ValueTransformer));
1106 function stringifyType(type) {
1107 if (type instanceof static_symbol_1.StaticSymbol) {
1108 return type.name + " in " + type.filePath;
1109 }
1110 else {
1111 return util_2.stringify(type);
1112 }
1113 }
1114 /**
1115 * Indicates that a component is still being loaded in a synchronous compile.
1116 */
1117 function componentStillLoadingError(compType) {
1118 var error = Error("Can't compile synchronously as " + util_2.stringify(compType) + " is still being loaded!");
1119 error[exports.ERROR_COMPONENT_TYPE] = compType;
1120 return error;
1121 }
1122});
1123//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0YWRhdGFfcmVzb2x2ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci9zcmMvbWV0YWRhdGFfcmVzb2x2ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7OztJQUVILHlFQUFvRTtJQUNwRSx1REFBNkM7SUFDN0MsK0RBQThFO0lBQzlFLDREQUEwQztJQUcxQyxtREFBZ1U7SUFFaFUsK0VBQWlFO0lBQ2pFLGlFQUEwQztJQUMxQyxpRkFBMkQ7SUFHM0QsK0RBQW9GO0lBR3BGLDJEQUF1QztJQUV2QyxtREFBOEg7SUFJakgsUUFBQSxvQkFBb0IsR0FBRyxpQkFBaUIsQ0FBQztJQUV0RCxJQUFNLHFDQUFxQyxHQUFHLG9DQUFvQyxDQUFDO0lBT25GLFNBQWdCLG1DQUFtQyxDQUFDLEtBQVU7O1FBRTVELE9BQU8sTUFBQSxLQUFLLENBQUMscUNBQXFDLENBQUMsbUNBQUksSUFBSSxDQUFDO0lBQzlELENBQUM7SUFIRCxrRkFHQztJQUVELGdCQUFnQjtJQUNoQixrQ0FBa0M7SUFDbEMsMkRBQTJEO0lBQzNELDhDQUE4QztJQUM5Qyw2REFBNkQ7SUFDN0QsNkRBQTZEO0lBQzdELHVCQUF1QjtJQUN2QjtRQVVFLGlDQUNZLE9BQXVCLEVBQVUsV0FBdUIsRUFDeEQsaUJBQW1DLEVBQVUsa0JBQXFDLEVBQ2xGLGFBQTJCLEVBQVUsZ0JBQXNDLEVBQzNFL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FbnRyeSBhcyBhbnkpLnRva2VuO1xuICAgICAgICAgIH0gZWxzZSBpZiAoXG4gICAgICAgICAgICAgIGNyZWF0ZUluamVjdGlvblRva2VuLmlzVHlwZU9mKHBhcmFtRW50cnkpIHx8XG4gICAgICAgICAgICAgIChwYXJhbUVudHJ5IGFzIGFueSkgaW5zdGFuY2VvZiBTdGF0aWNTeW1ib2wpIHtcbiAgICAgICAgICAgIHRva2VuID0gcGFyYW1FbnRyeTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGlzVmFsaWRUeXBlKHBhcmFtRW50cnkpICYmIHRva2VuID09IG51bGwpIHtcbiAgICAgICAgICAgIHRva2VuID0gcGFyYW1FbnRyeTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdG9rZW4gPSBwYXJhbTtcbiAgICAgIH1cbiAgICAgIGlmICh0b2tlbiA9PSBudWxsKSB7XG4gICAgICAgIGhhc1Vua25vd25EZXBzID0gdHJ1ZTtcbiAgICAgICAgcmV0dXJuIHt9O1xuICAgICAgfVxuXG4gICAgICByZXR1cm4ge1xuICAgICAgICBpc0F0dHJpYnV0ZSxcbiAgICAgICAgaXNIb3N0LFxuICAgICAgICBpc1NlbGYsXG4gICAgICAgIGlzU2tpcFNlbGYsXG4gICAgICAgIGlzT3B0aW9uYWwsXG4gICAgICAgIHRva2VuOiB0aGlzLl9nZXRUb2tlbk1ldGFkYXRhKHRva2VuKVxuICAgICAgfTtcbiAgICB9KTtcblxuICAgIGlmIChoYXNVbmtub3duRGVwcykge1xuICAgICAgY29uc3QgZGVwc1Rva2VucyA9XG4gICAgICAgICAgZGVwZW5kZW5jaWVzTWV0YWRhdGEubWFwKChkZXApID0+IGRlcC50b2tlbiA/IHN0cmluZ2lmeVR5cGUoZGVwLnRva2VuKSA6ICc/Jykuam9pbignLCAnKTtcbiAgICAgIGNvbnN0IG1lc3NhZ2UgPVxuICAgICAgICAgIGBDYW4ndCByZXNvbHZl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VyISBVc3VhbGx5IHRoaXMgbWVhbnMgeW91IGhhdmUgYSBjaXJjdWxhciBkZXBlbmRlbmNpZXMuIFRoaXMgbWlnaHQgYmUgY2F1c2VkIGJ5IHVzaW5nICdiYXJyZWwnIGluZGV4LnRzIGZpbGVzLmApKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgY29uc3QgcHJvdmlkZXJzSW5mbyA9XG4gICAgICAgICAgICAgIHByb3ZpZGVyc1xuICAgICAgICAgICAgICAgICAgLnJlZHVjZShcbiAgICAgICAgICAgICAgICAgICAgICAoc29GYXI6IHN0cmluZ1tdLCBzZWVuUHJvdmlkZXI6IGFueSwgc2VlblByb3ZpZGVySWR4OiBudW1iZXIpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWVuUHJvdmlkZXJJZHggPCBwcm92aWRlcklkeCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBzb0Zhci5wdXNoKGAke3N0cmluZ2lmeVR5cGUoc2VlblByb3ZpZGVyKX1gKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2VlblByb3ZpZGVySWR4ID09IHByb3ZpZGVySWR4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHNvRmFyLnB1c2goYD8ke3N0cmluZ2lmeVR5cGUoc2VlblByb3ZpZGVyKX0/YCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNlZW5Qcm92aWRlcklkeCA9PSBwcm92aWRlcklkeCArIDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgc29GYXIucHVzaCgnLi4uJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc29GYXI7XG4gICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICBbXSlcbiAgICAgICAgICAgICAgICAgIC5qb2luKCcsICcpO1xuICAgICAgICAgIHRoaXMuX3JlcG9ydEVycm9yKFxuICAgICAgICAgICAgICBzeW50YXhFcnJvcihgSW52YWxpZCAke1xuICAgICAgICAgICAgICAgICAgZGVidWdJbmZvID9cbiAgICAgICAgICAgICAgICAgICAgICBkZWJ1Z0luZm8gOlxuICAgICAgICAgICAgICAgICAgICAgICdwcm92aWRlcid9IC0gb25seSBpbnN0YW5jZXMgb2YgUHJvdmlkZXIgYW5kIFR5cGUgYXJlIGFsbG93ZWQsIGdvdDogWyR7XG4gICAgICAgICAgICAgICAgICBwcm92aWRlcnNJbmZvfV1gKSxcbiAgICAgICAgICAgICAgdHlwZSk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChwcm92aWRlck1ldGEudG9rZW4gPT09XG4gICAgICAgICAgICB0aGlzLl9yZWZsZWN0b3IucmVzb2x2ZUV4dGVybmFsUmVmZXJlbmNlKElkZW50aWZpZXJzLkFOQUxZWkVfRk9SX0VOVFJZX0NPTVBPTkVOVFMpKSB7XG4gICAgICAgICAgdGFyZ2V0RW50cnlDb21wb25lbnRzLnB1c2goLi4udGhpcy5fZ2V0RW50cnlDb21wb25lbnRzRnJvbVByb3ZpZGVyKHByb3ZpZGVyTWV0YSwgdHlwZSkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNvbXBpbGVQcm92aWRlcnMucHVzaCh0aGlzLmdldFByb3ZpZGVyTWV0YWRhdGEocHJvdmlkZXJNZXRhKSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcbiAgICByZXR1cm4gY29tcGlsZVByb3ZpZGVycztcbiAgfVxuXG4gIHByaXZhdGUgX3ZhbGlkYXRlUHJvdmlkZXIocHJvdmlkZXI6IGFueSk6IHZvaWQge1xuICAgIGlmIChwcm92aWRlci5oYXNPd25Qcm9wZXJ0eSgndXNlQ2xhc3MnKSAmJiBwcm92aWRlci51c2VDbGFzcyA9PSBudWxsKSB7XG4gICAgIC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OiBDb21waWxlSWRlbnRpZmllck1ldGFkYXRhW10pOiBhbnkge1xuICAgIHRhcmdldElkZW50aWZpZXJzLnB1c2goe3JlZmVyZW5jZTogdmFsdWV9KTtcbiAgfVxufVxuXG5mdW5jdGlvbiBzdHJpbmdpZnlUeXBlKHR5cGU6IGFueSk6IHN0cmluZyB7XG4gIGlmICh0eXBlIGluc3RhbmNlb2YgU3RhdGljU3ltYm9sKSB7XG4gICAgcmV0dXJuIGAke3R5cGUubmFtZX0gaW4gJHt0eXBlLmZpbGVQYXRofWA7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIHN0cmluZ2lmeSh0eXBlKTtcbiAgfVxufVxuXG4vKipcbiAqIEluZGljYXRlcyB0aGF0IGEgY29tcG9uZW50IGlzIHN0aWxsIGJlaW5nIGxvYWRlZCBpbiBhIHN5bmNocm9ub3VzIGNvbXBpbGUuXG4gKi9cbmZ1bmN0aW9uIGNvbXBvbmVudFN0aWxsTG9hZGluZ0Vycm9yKGNvbXBUeXBlOiBUeXBlKSB7XG4gIGNvbnN0IGVycm9yID1cbiAgICAgIEVycm9yKGBDYW4ndCBjb21waWxlIHN5bmNocm9ub3VzbHkgYXMgJHtzdHJpbmdpZnkoY29tcFR5cGUpfSBpcyBzdGlsbCBiZWluZyBsb2FkZWQhYCk7XG4gIChlcnJvciBhcyBhbnkpW0VSUk9SX0NPTVBPTkVOVF9UWVBFXSA9IGNvbXBUeXBlO1xuICByZXR1cm4gZXJyb3I7XG59XG4iXX0=
Note: See TracBrowser for help on using the repository browser.