1
|
import * as tslib_1 from "tslib";
|
2
|
/**
|
3
|
* @license Angular v4.4.6
|
4
|
* (c) 2010-2017 Google, Inc. https://angular.io/
|
5
|
* License: MIT
|
6
|
*/
|
7
|
import { COMPILER_OPTIONS, Compiler, CompilerFactory, Component, Directive, Injectable, Injector, NgModule, Pipe, SecurityContext, createPlatformFactory, ɵstringify } from '@angular/core';
|
8
|
import { CompileMetadataResolver, CompileReflector, DirectiveResolver, NgModuleResolver, PipeResolver, platformCoreDynamic } from '@angular/compiler';
|
9
|
import { ɵTestingCompilerFactory } from '@angular/core/testing';
|
10
|
/**
|
11
|
* @license
|
12
|
* Copyright Google Inc. All Rights Reserved.
|
13
|
*
|
14
|
* Use of this source code is governed by an MIT-style license that can be
|
15
|
* found in the LICENSE file at https://angular.io/license
|
16
|
*/
|
17
|
var MockSchemaRegistry = (function () {
|
18
|
function MockSchemaRegistry(existingProperties, attrPropMapping, existingElements, invalidProperties, invalidAttributes) {
|
19
|
this.existingProperties = existingProperties;
|
20
|
this.attrPropMapping = attrPropMapping;
|
21
|
this.existingElements = existingElements;
|
22
|
this.invalidProperties = invalidProperties;
|
23
|
this.invalidAttributes = invalidAttributes;
|
24
|
}
|
25
|
MockSchemaRegistry.prototype.hasProperty = function (tagName, property, schemas) {
|
26
|
var value = this.existingProperties[property];
|
27
|
return value === void 0 ? true : value;
|
28
|
};
|
29
|
MockSchemaRegistry.prototype.hasElement = function (tagName, schemaMetas) {
|
30
|
var value = this.existingElements[tagName.toLowerCase()];
|
31
|
return value === void 0 ? true : value;
|
32
|
};
|
33
|
MockSchemaRegistry.prototype.allKnownElementNames = function () { return Object.keys(this.existingElements); };
|
34
|
MockSchemaRegistry.prototype.securityContext = function (selector, property, isAttribute) {
|
35
|
return SecurityContext.NONE;
|
36
|
};
|
37
|
MockSchemaRegistry.prototype.getMappedPropName = function (attrName) { return this.attrPropMapping[attrName] || attrName; };
|
38
|
MockSchemaRegistry.prototype.getDefaultComponentElementName = function () { return 'ng-component'; };
|
39
|
MockSchemaRegistry.prototype.validateProperty = function (name) {
|
40
|
if (this.invalidProperties.indexOf(name) > -1) {
|
41
|
return { error: true, msg: "Binding to property '" + name + "' is disallowed for security reasons" };
|
42
|
}
|
43
|
else {
|
44
|
return { error: false };
|
45
|
}
|
46
|
};
|
47
|
MockSchemaRegistry.prototype.validateAttribute = function (name) {
|
48
|
if (this.invalidAttributes.indexOf(name) > -1) {
|
49
|
return {
|
50
|
error: true,
|
51
|
msg: "Binding to attribute '" + name + "' is disallowed for security reasons"
|
52
|
};
|
53
|
}
|
54
|
else {
|
55
|
return { error: false };
|
56
|
}
|
57
|
};
|
58
|
MockSchemaRegistry.prototype.normalizeAnimationStyleProperty = function (propName) { return propName; };
|
59
|
MockSchemaRegistry.prototype.normalizeAnimationStyleValue = function (camelCaseProp, userProvidedProp, val) {
|
60
|
return { error: null, value: val.toString() };
|
61
|
};
|
62
|
return MockSchemaRegistry;
|
63
|
}());
|
64
|
/**
|
65
|
* @license
|
66
|
* Copyright Google Inc. All Rights Reserved.
|
67
|
*
|
68
|
* Use of this source code is governed by an MIT-style license that can be
|
69
|
* found in the LICENSE file at https://angular.io/license
|
70
|
*/
|
71
|
/**
|
72
|
* An implementation of {@link DirectiveResolver} that allows overriding
|
73
|
* various properties of directives.
|
74
|
*/
|
75
|
var MockDirectiveResolver = (function (_super) {
|
76
|
tslib_1.__extends(MockDirectiveResolver, _super);
|
77
|
function MockDirectiveResolver(_injector, reflector) {
|
78
|
var _this = _super.call(this, reflector) || this;
|
79
|
_this._injector = _injector;
|
80
|
_this._directives = new Map();
|
81
|
_this._providerOverrides = new Map();
|
82
|
_this._viewProviderOverrides = new Map();
|
83
|
_this._views = new Map();
|
84
|
_this._inlineTemplates = new Map();
|
85
|
return _this;
|
86
|
}
|
87
|
Object.defineProperty(MockDirectiveResolver.prototype, "_compiler", {
|
88
|
get: function () { return this._injector.get(Compiler); },
|
89
|
enumerable: true,
|
90
|
configurable: true
|
91
|
});
|
92
|
MockDirectiveResolver.prototype._clearCacheFor = function (component) { this._compiler.clearCacheFor(component); };
|
93
|
MockDirectiveResolver.prototype.resolve = function (type, throwIfNotFound) {
|
94
|
if (throwIfNotFound === void 0) { throwIfNotFound = true; }
|
95
|
var metadata = this._directives.get(type) || null;
|
96
|
if (!metadata) {
|
97
|
metadata = _super.prototype.resolve.call(this, type, throwIfNotFound);
|
98
|
}
|
99
|
if (!metadata) {
|
100
|
return null;
|
101
|
}
|
102
|
var providerOverrides = this._providerOverrides.get(type);
|
103
|
var viewProviderOverrides = this._viewProviderOverrides.get(type);
|
104
|
var providers = metadata.providers;
|
105
|
if (providerOverrides != null) {
|
106
|
var originalViewProviders = metadata.providers || [];
|
107
|
providers = originalViewProviders.concat(providerOverrides);
|
108
|
}
|
109
|
if (metadata instanceof Component) {
|
110
|
var viewProviders = metadata.viewProviders;
|
111
|
if (viewProviderOverrides != null) {
|
112
|
var originalViewProviders = metadata.viewProviders || [];
|
113
|
viewProviders = originalViewProviders.concat(viewProviderOverrides);
|
114
|
}
|
115
|
var view = this._views.get(type) || metadata;
|
116
|
var animations = view.animations;
|
117
|
var templateUrl = view.templateUrl;
|
118
|
var inlineTemplate = this._inlineTemplates.get(type);
|
119
|
if (inlineTemplate) {
|
120
|
templateUrl = undefined;
|
121
|
}
|
122
|
else {
|
123
|
inlineTemplate = view.template;
|
124
|
}
|
125
|
return new Component({
|
126
|
selector: metadata.selector,
|
127
|
inputs: metadata.inputs,
|
128
|
outputs: metadata.outputs,
|
129
|
host: metadata.host,
|
130
|
exportAs: metadata.exportAs,
|
131
|
moduleId: metadata.moduleId,
|
132
|
queries: metadata.queries,
|
133
|
changeDetection: metadata.changeDetection,
|
134
|
providers: providers,
|
135
|
viewProviders: viewProviders,
|
136
|
entryComponents: metadata.entryComponents,
|
137
|
template: inlineTemplate,
|
138
|
templateUrl: templateUrl,
|
139
|
animations: animations,
|
140
|
styles: view.styles,
|
141
|
styleUrls: view.styleUrls,
|
142
|
encapsulation: view.encapsulation,
|
143
|
interpolation: view.interpolation,
|
144
|
preserveWhitespaces: view.preserveWhitespaces,
|
145
|
});
|
146
|
}
|
147
|
return new Directive({
|
148
|
selector: metadata.selector,
|
149
|
inputs: metadata.inputs,
|
150
|
outputs: metadata.outputs,
|
151
|
host: metadata.host,
|
152
|
providers: providers,
|
153
|
exportAs: metadata.exportAs,
|
154
|
queries: metadata.queries
|
155
|
});
|
156
|
};
|
157
|
/**
|
158
|
* Overrides the {@link Directive} for a directive.
|
159
|
*/
|
160
|
MockDirectiveResolver.prototype.setDirective = function (type, metadata) {
|
161
|
this._directives.set(type, metadata);
|
162
|
this._clearCacheFor(type);
|
163
|
};
|
164
|
MockDirectiveResolver.prototype.setProvidersOverride = function (type, providers) {
|
165
|
this._providerOverrides.set(type, providers);
|
166
|
this._clearCacheFor(type);
|
167
|
};
|
168
|
MockDirectiveResolver.prototype.setViewProvidersOverride = function (type, viewProviders) {
|
169
|
this._viewProviderOverrides.set(type, viewProviders);
|
170
|
this._clearCacheFor(type);
|
171
|
};
|
172
|
/**
|
173
|
* Overrides the {@link ViewMetadata} for a component.
|
174
|
*/
|
175
|
MockDirectiveResolver.prototype.setView = function (component, view) {
|
176
|
this._views.set(component, view);
|
177
|
this._clearCacheFor(component);
|
178
|
};
|
179
|
/**
|
180
|
* Overrides the inline template for a component - other configuration remains unchanged.
|
181
|
*/
|
182
|
MockDirectiveResolver.prototype.setInlineTemplate = function (component, template) {
|
183
|
this._inlineTemplates.set(component, template);
|
184
|
this._clearCacheFor(component);
|
185
|
};
|
186
|
return MockDirectiveResolver;
|
187
|
}(DirectiveResolver));
|
188
|
MockDirectiveResolver.decorators = [
|
189
|
{ type: Injectable },
|
190
|
];
|
191
|
/** @nocollapse */
|
192
|
MockDirectiveResolver.ctorParameters = function () { return [
|
193
|
{ type: Injector, },
|
194
|
{ type: CompileReflector, },
|
195
|
]; };
|
196
|
/**
|
197
|
* @license
|
198
|
* Copyright Google Inc. All Rights Reserved.
|
199
|
*
|
200
|
* Use of this source code is governed by an MIT-style license that can be
|
201
|
* found in the LICENSE file at https://angular.io/license
|
202
|
*/
|
203
|
var MockNgModuleResolver = (function (_super) {
|
204
|
tslib_1.__extends(MockNgModuleResolver, _super);
|
205
|
function MockNgModuleResolver(_injector, reflector) {
|
206
|
var _this = _super.call(this, reflector) || this;
|
207
|
_this._injector = _injector;
|
208
|
_this._ngModules = new Map();
|
209
|
return _this;
|
210
|
}
|
211
|
/**
|
212
|
* Overrides the {@link NgModule} for a module.
|
213
|
*/
|
214
|
MockNgModuleResolver.prototype.setNgModule = function (type, metadata) {
|
215
|
this._ngModules.set(type, metadata);
|
216
|
this._clearCacheFor(type);
|
217
|
};
|
218
|
/**
|
219
|
* Returns the {@link NgModule} for a module:
|
220
|
* - Set the {@link NgModule} to the overridden view when it exists or fallback to the
|
221
|
* default
|
222
|
* `NgModuleResolver`, see `setNgModule`.
|
223
|
*/
|
224
|
MockNgModuleResolver.prototype.resolve = function (type, throwIfNotFound) {
|
225
|
if (throwIfNotFound === void 0) { throwIfNotFound = true; }
|
226
|
return this._ngModules.get(type) || _super.prototype.resolve.call(this, type, throwIfNotFound);
|
227
|
};
|
228
|
Object.defineProperty(MockNgModuleResolver.prototype, "_compiler", {
|
229
|
get: function () { return this._injector.get(Compiler); },
|
230
|
enumerable: true,
|
231
|
configurable: true
|
232
|
});
|
233
|
MockNgModuleResolver.prototype._clearCacheFor = function (component) { this._compiler.clearCacheFor(component); };
|
234
|
return MockNgModuleResolver;
|
235
|
}(NgModuleResolver));
|
236
|
MockNgModuleResolver.decorators = [
|
237
|
{ type: Injectable },
|
238
|
];
|
239
|
/** @nocollapse */
|
240
|
MockNgModuleResolver.ctorParameters = function () { return [
|
241
|
{ type: Injector, },
|
242
|
{ type: CompileReflector, },
|
243
|
]; };
|
244
|
/**
|
245
|
* @license
|
246
|
* Copyright Google Inc. All Rights Reserved.
|
247
|
*
|
248
|
* Use of this source code is governed by an MIT-style license that can be
|
249
|
* found in the LICENSE file at https://angular.io/license
|
250
|
*/
|
251
|
var MockPipeResolver = (function (_super) {
|
252
|
tslib_1.__extends(MockPipeResolver, _super);
|
253
|
function MockPipeResolver(_injector, refector) {
|
254
|
var _this = _super.call(this, refector) || this;
|
255
|
_this._injector = _injector;
|
256
|
_this._pipes = new Map();
|
257
|
return _this;
|
258
|
}
|
259
|
Object.defineProperty(MockPipeResolver.prototype, "_compiler", {
|
260
|
get: function () { return this._injector.get(Compiler); },
|
261
|
enumerable: true,
|
262
|
configurable: true
|
263
|
});
|
264
|
MockPipeResolver.prototype._clearCacheFor = function (pipe) { this._compiler.clearCacheFor(pipe); };
|
265
|
/**
|
266
|
* Overrides the {@link Pipe} for a pipe.
|
267
|
*/
|
268
|
MockPipeResolver.prototype.setPipe = function (type, metadata) {
|
269
|
this._pipes.set(type, metadata);
|
270
|
this._clearCacheFor(type);
|
271
|
};
|
272
|
/**
|
273
|
* Returns the {@link Pipe} for a pipe:
|
274
|
* - Set the {@link Pipe} to the overridden view when it exists or fallback to the
|
275
|
* default
|
276
|
* `PipeResolver`, see `setPipe`.
|
277
|
*/
|
278
|
MockPipeResolver.prototype.resolve = function (type, throwIfNotFound) {
|
279
|
if (throwIfNotFound === void 0) { throwIfNotFound = true; }
|
280
|
var metadata = this._pipes.get(type);
|
281
|
if (!metadata) {
|
282
|
metadata = _super.prototype.resolve.call(this, type, throwIfNotFound);
|
283
|
}
|
284
|
return metadata;
|
285
|
};
|
286
|
return MockPipeResolver;
|
287
|
}(PipeResolver));
|
288
|
MockPipeResolver.decorators = [
|
289
|
{ type: Injectable },
|
290
|
];
|
291
|
/** @nocollapse */
|
292
|
MockPipeResolver.ctorParameters = function () { return [
|
293
|
{ type: Injector, },
|
294
|
{ type: CompileReflector, },
|
295
|
]; };
|
296
|
/**
|
297
|
* @license
|
298
|
* Copyright Google Inc. All Rights Reserved.
|
299
|
*
|
300
|
* Use of this source code is governed by an MIT-style license that can be
|
301
|
* found in the LICENSE file at https://angular.io/license
|
302
|
*/
|
303
|
var _nextReferenceId = 0;
|
304
|
var MetadataOverrider = (function () {
|
305
|
function MetadataOverrider() {
|
306
|
this._references = new Map();
|
307
|
}
|
308
|
/**
|
309
|
* Creates a new instance for the given metadata class
|
310
|
* based on an old instance and overrides.
|
311
|
*/
|
312
|
MetadataOverrider.prototype.overrideMetadata = function (metadataClass, oldMetadata, override) {
|
313
|
var props = {};
|
314
|
if (oldMetadata) {
|
315
|
_valueProps(oldMetadata).forEach(function (prop) { return props[prop] = oldMetadata[prop]; });
|
316
|
}
|
317
|
if (override.set) {
|
318
|
if (override.remove || override.add) {
|
319
|
throw new Error("Cannot set and add/remove " + ɵstringify(metadataClass) + " at the same time!");
|
320
|
}
|
321
|
setMetadata(props, override.set);
|
322
|
}
|
323
|
if (override.remove) {
|
324
|
removeMetadata(props, override.remove, this._references);
|
325
|
}
|
326
|
if (override.add) {
|
327
|
addMetadata(props, override.add);
|
328
|
}
|
329
|
return new metadataClass(props);
|
330
|
};
|
331
|
return MetadataOverrider;
|
332
|
}());
|
333
|
function removeMetadata(metadata, remove, references) {
|
334
|
var removeObjects = new Set();
|
335
|
var _loop_1 = function (prop) {
|
336
|
var removeValue = remove[prop];
|
337
|
if (removeValue instanceof Array) {
|
338
|
removeValue.forEach(function (value) { removeObjects.add(_propHashKey(prop, value, references)); });
|
339
|
}
|
340
|
else {
|
341
|
removeObjects.add(_propHashKey(prop, removeValue, references));
|
342
|
}
|
343
|
};
|
344
|
for (var prop in remove) {
|
345
|
_loop_1(prop);
|
346
|
}
|
347
|
var _loop_2 = function (prop) {
|
348
|
var propValue = metadata[prop];
|
349
|
if (propValue instanceof Array) {
|
350
|
metadata[prop] = propValue.filter(function (value) { return !removeObjects.has(_propHashKey(prop, value, references)); });
|
351
|
}
|
352
|
else {
|
353
|
if (removeObjects.has(_propHashKey(prop, propValue, references))) {
|
354
|
metadata[prop] = undefined;
|
355
|
}
|
356
|
}
|
357
|
};
|
358
|
for (var prop in metadata) {
|
359
|
_loop_2(prop);
|
360
|
}
|
361
|
}
|
362
|
function addMetadata(metadata, add) {
|
363
|
for (var prop in add) {
|
364
|
var addValue = add[prop];
|
365
|
var propValue = metadata[prop];
|
366
|
if (propValue != null && propValue instanceof Array) {
|
367
|
metadata[prop] = propValue.concat(addValue);
|
368
|
}
|
369
|
else {
|
370
|
metadata[prop] = addValue;
|
371
|
}
|
372
|
}
|
373
|
}
|
374
|
function setMetadata(metadata, set) {
|
375
|
for (var prop in set) {
|
376
|
metadata[prop] = set[prop];
|
377
|
}
|
378
|
}
|
379
|
function _propHashKey(propName, propValue, references) {
|
380
|
var replacer = function (key, value) {
|
381
|
if (typeof value === 'function') {
|
382
|
value = _serializeReference(value, references);
|
383
|
}
|
384
|
return value;
|
385
|
};
|
386
|
return propName + ":" + JSON.stringify(propValue, replacer);
|
387
|
}
|
388
|
function _serializeReference(ref, references) {
|
389
|
var id = references.get(ref);
|
390
|
if (!id) {
|
391
|
id = "" + ɵstringify(ref) + _nextReferenceId++;
|
392
|
references.set(ref, id);
|
393
|
}
|
394
|
return id;
|
395
|
}
|
396
|
function _valueProps(obj) {
|
397
|
var props = [];
|
398
|
// regular public props
|
399
|
Object.keys(obj).forEach(function (prop) {
|
400
|
if (!prop.startsWith('_')) {
|
401
|
props.push(prop);
|
402
|
}
|
403
|
});
|
404
|
// getters
|
405
|
var proto = obj;
|
406
|
while (proto = Object.getPrototypeOf(proto)) {
|
407
|
Object.keys(proto).forEach(function (protoProp) {
|
408
|
var desc = Object.getOwnPropertyDescriptor(proto, protoProp);
|
409
|
if (!protoProp.startsWith('_') && desc && 'get' in desc) {
|
410
|
props.push(protoProp);
|
411
|
}
|
412
|
});
|
413
|
}
|
414
|
return props;
|
415
|
}
|
416
|
/**
|
417
|
* @license
|
418
|
* Copyright Google Inc. All Rights Reserved.
|
419
|
*
|
420
|
* Use of this source code is governed by an MIT-style license that can be
|
421
|
* found in the LICENSE file at https://angular.io/license
|
422
|
*/
|
423
|
/**
|
424
|
* @module
|
425
|
* @description
|
426
|
* Entry point for all APIs of the compiler package.
|
427
|
*
|
428
|
* <div class="callout is-critical">
|
429
|
* <header>Unstable APIs</header>
|
430
|
* <p>
|
431
|
* All compiler apis are currently considered experimental and private!
|
432
|
* </p>
|
433
|
* <p>
|
434
|
* We expect the APIs in this package to keep on changing. Do not rely on them.
|
435
|
* </p>
|
436
|
* </div>
|
437
|
*/
|
438
|
var TestingCompilerFactoryImpl = (function () {
|
439
|
function TestingCompilerFactoryImpl(_compilerFactory) {
|
440
|
this._compilerFactory = _compilerFactory;
|
441
|
}
|
442
|
TestingCompilerFactoryImpl.prototype.createTestingCompiler = function (options) {
|
443
|
var compiler = this._compilerFactory.createCompiler(options);
|
444
|
return new TestingCompilerImpl(compiler, compiler.injector.get(MockDirectiveResolver), compiler.injector.get(MockPipeResolver), compiler.injector.get(MockNgModuleResolver), compiler.injector.get(CompileMetadataResolver));
|
445
|
};
|
446
|
return TestingCompilerFactoryImpl;
|
447
|
}());
|
448
|
TestingCompilerFactoryImpl.decorators = [
|
449
|
{ type: Injectable },
|
450
|
];
|
451
|
/** @nocollapse */
|
452
|
TestingCompilerFactoryImpl.ctorParameters = function () { return [
|
453
|
{ type: CompilerFactory, },
|
454
|
]; };
|
455
|
var TestingCompilerImpl = (function () {
|
456
|
function TestingCompilerImpl(_compiler, _directiveResolver, _pipeResolver, _moduleResolver, _metadataResolver) {
|
457
|
this._compiler = _compiler;
|
458
|
this._directiveResolver = _directiveResolver;
|
459
|
this._pipeResolver = _pipeResolver;
|
460
|
this._moduleResolver = _moduleResolver;
|
461
|
this._metadataResolver = _metadataResolver;
|
462
|
this._overrider = new MetadataOverrider();
|
463
|
}
|
464
|
Object.defineProperty(TestingCompilerImpl.prototype, "injector", {
|
465
|
get: function () { return this._compiler.injector; },
|
466
|
enumerable: true,
|
467
|
configurable: true
|
468
|
});
|
469
|
TestingCompilerImpl.prototype.compileModuleSync = function (moduleType) {
|
470
|
return this._compiler.compileModuleSync(moduleType);
|
471
|
};
|
472
|
TestingCompilerImpl.prototype.compileModuleAsync = function (moduleType) {
|
473
|
return this._compiler.compileModuleAsync(moduleType);
|
474
|
};
|
475
|
TestingCompilerImpl.prototype.compileModuleAndAllComponentsSync = function (moduleType) {
|
476
|
return this._compiler.compileModuleAndAllComponentsSync(moduleType);
|
477
|
};
|
478
|
TestingCompilerImpl.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {
|
479
|
return this._compiler.compileModuleAndAllComponentsAsync(moduleType);
|
480
|
};
|
481
|
TestingCompilerImpl.prototype.getNgContentSelectors = function (component) {
|
482
|
return this._compiler.getNgContentSelectors(component);
|
483
|
};
|
484
|
TestingCompilerImpl.prototype.getComponentFactory = function (component) {
|
485
|
return this._compiler.getComponentFactory(component);
|
486
|
};
|
487
|
TestingCompilerImpl.prototype.checkOverrideAllowed = function (type) {
|
488
|
if (this._compiler.hasAotSummary(type)) {
|
489
|
throw new Error(ɵstringify(type) + " was AOT compiled, so its metadata cannot be changed.");
|
490
|
}
|
491
|
};
|
492
|
TestingCompilerImpl.prototype.overrideModule = function (ngModule, override) {
|
493
|
this.checkOverrideAllowed(ngModule);
|
494
|
var oldMetadata = this._moduleResolver.resolve(ngModule, false);
|
495
|
this._moduleResolver.setNgModule(ngModule, this._overrider.overrideMetadata(NgModule, oldMetadata, override));
|
496
|
};
|
497
|
TestingCompilerImpl.prototype.overrideDirective = function (directive, override) {
|
498
|
this.checkOverrideAllowed(directive);
|
499
|
var oldMetadata = this._directiveResolver.resolve(directive, false);
|
500
|
this._directiveResolver.setDirective(directive, this._overrider.overrideMetadata(Directive, oldMetadata, override));
|
501
|
};
|
502
|
TestingCompilerImpl.prototype.overrideComponent = function (component, override) {
|
503
|
this.checkOverrideAllowed(component);
|
504
|
var oldMetadata = this._directiveResolver.resolve(component, false);
|
505
|
this._directiveResolver.setDirective(component, this._overrider.overrideMetadata(Component, oldMetadata, override));
|
506
|
};
|
507
|
TestingCompilerImpl.prototype.overridePipe = function (pipe, override) {
|
508
|
this.checkOverrideAllowed(pipe);
|
509
|
var oldMetadata = this._pipeResolver.resolve(pipe, false);
|
510
|
this._pipeResolver.setPipe(pipe, this._overrider.overrideMetadata(Pipe, oldMetadata, override));
|
511
|
};
|
512
|
TestingCompilerImpl.prototype.loadAotSummaries = function (summaries) { this._compiler.loadAotSummaries(summaries); };
|
513
|
TestingCompilerImpl.prototype.clearCache = function () { this._compiler.clearCache(); };
|
514
|
TestingCompilerImpl.prototype.clearCacheFor = function (type) { this._compiler.clearCacheFor(type); };
|
515
|
return TestingCompilerImpl;
|
516
|
}());
|
517
|
/**
|
518
|
* Platform for dynamic tests
|
519
|
*
|
520
|
* @experimental
|
521
|
*/
|
522
|
var platformCoreDynamicTesting = createPlatformFactory(platformCoreDynamic, 'coreDynamicTesting', [
|
523
|
{
|
524
|
provide: COMPILER_OPTIONS,
|
525
|
useValue: {
|
526
|
providers: [
|
527
|
MockPipeResolver,
|
528
|
{ provide: PipeResolver, useExisting: MockPipeResolver },
|
529
|
MockDirectiveResolver,
|
530
|
{ provide: DirectiveResolver, useExisting: MockDirectiveResolver },
|
531
|
MockNgModuleResolver,
|
532
|
{ provide: NgModuleResolver, useExisting: MockNgModuleResolver },
|
533
|
]
|
534
|
},
|
535
|
multi: true
|
536
|
},
|
537
|
{ provide: ɵTestingCompilerFactory, useClass: TestingCompilerFactoryImpl }
|
538
|
]);
|
539
|
/**
|
540
|
* @license
|
541
|
* Copyright Google Inc. All Rights Reserved.
|
542
|
*
|
543
|
* Use of this source code is governed by an MIT-style license that can be
|
544
|
* found in the LICENSE file at https://angular.io/license
|
545
|
*/
|
546
|
/**
|
547
|
* @module
|
548
|
* @description
|
549
|
* Entry point for all public APIs of the compiler/testing package.
|
550
|
*/
|
551
|
export { TestingCompilerFactoryImpl, TestingCompilerImpl, platformCoreDynamicTesting, MockSchemaRegistry, MockDirectiveResolver, MockNgModuleResolver, MockPipeResolver };
|
552
|
//# sourceMappingURL=testing.es5.js.map
|