Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
TemplateCompiler.prototype._compileNestedComponentRuntime = function (childComponentDir, parentCompilingComponentsPath, childPromises) {
var compilingComponentsPath = collection_1.ListWrapper.clone(parentCompilingComponentsPath);
var childCacheKey = childComponentDir.type.runtime;
var childViewDirectives = this._runtimeMetadataResolver.getViewDirectivesMetadata(childComponentDir.type.runtime);
var childViewPipes = this._runtimeMetadataResolver.getViewPipesMetadata(childComponentDir.type.runtime);
var childIsRecursive = collection_1.ListWrapper.contains(compilingComponentsPath, childCacheKey);
this._compileComponentRuntime(childCacheKey, childComponentDir, childViewDirectives, childViewPipes, compilingComponentsPath);
if (!childIsRecursive) {
// Only wait for a child if it is not a cycle
childPromises.push(this._compiledTemplateDone.get(childCacheKey));
}
};
TemplateCompiler.prototype._createViewFactoryRuntime = function (compMeta, parsedTemplate, directives, styles, pipes) {
ShadowDomCompileStep.prototype._processStyleElement = function (current, control) {
var stylePromise = this._shadowDomStrategy.processStyleElement(this._template.componentId, this._template.templateAbsUrl, current.element);
if (lang_1.isPresent(stylePromise) && lang_1.isPromise(stylePromise)) {
collection_1.ListWrapper.push(this._subTaskPromises, stylePromise);
}
// Style elements should not be further processed by the compiler, as they can not contain
// bindings. Skipping further compiler steps allow speeding up the compilation process.
control.ignoreCurrentElement();
};
ShadowDomCompileStep.prototype._processContentElement = function (current) {
function _findMatching(r, rs) {
return collection_1.ListWrapper.find(rs, function (rr) { return rr.mode !== proto_record_1.RecordType.DIRECTIVE_LIFECYCLE &&
rr.mode === r.mode && rr.funcOrValue === r.funcOrValue &&
rr.contextIndex === r.contextIndex &&
collection_1.ListWrapper.equals(rr.args, r.args); });
}
function _replaceIndices(r, selfIndex, indexMap) {
function ProtoInjectorDynamicStrategy(protoInj, bwv) {
var len = bwv.length;
this.providers = collection_1.ListWrapper.createFixedSize(len);
this.keyIds = collection_1.ListWrapper.createFixedSize(len);
this.visibilities = collection_1.ListWrapper.createFixedSize(len);
for (var i = 0; i < len; i++) {
this.providers[i] = bwv[i].provider;
this.keyIds[i] = bwv[i].getKeyId();
this.visibilities[i] = bwv[i].visibility;
}
}
ProtoInjectorDynamicStrategy.prototype.getProviderAtIndex = function (index) {
LiteralArray.prototype.eval = function (context, locals) {
return collection_1.ListWrapper.map(this.expressions, function (e) { return e.eval(context, locals); });
};
LiteralArray.prototype.visit = function (visitor) { return visitor.visitLiteralArray(this); };
if (provider.multiProvider !== existing.multiProvider) {
throw new reflective_exceptions_1.MixingMultiProvidersWithRegularProvidersError(existing, provider);
}
if (provider.multiProvider) {
for (var j = 0; j < provider.resolvedFactories.length; j++) {
existing.resolvedFactories.push(provider.resolvedFactories[j]);
}
}
else {
normalizedProvidersMap.set(provider.key.id, provider);
}
}
else {
var resolvedProvider;
if (provider.multiProvider) {
resolvedProvider = new ResolvedReflectiveProvider_(provider.key, collection_1.ListWrapper.clone(provider.resolvedFactories), provider.multiProvider);
}
else {
resolvedProvider = provider;
}
normalizedProvidersMap.set(provider.key.id, resolvedProvider);
}
}
return normalizedProvidersMap;
}
exports.mergeResolvedReflectiveProviders = mergeResolvedReflectiveProviders;
if (provider.multiProvider !== existing.multiProvider) {
throw new exceptions_2.MixingMultiProvidersWithRegularProvidersError(existing, provider);
}
if (provider.multiProvider) {
for (var j = 0; j < provider.resolvedFactories.length; j++) {
existing.resolvedFactories.push(provider.resolvedFactories[j]);
}
}
else {
normalizedProvidersMap.set(provider.key.id, provider);
}
}
else {
var resolvedProvider;
if (provider.multiProvider) {
resolvedProvider = new ResolvedProvider_(provider.key, collection_1.ListWrapper.clone(provider.resolvedFactories), provider.multiProvider);
}
else {
resolvedProvider = provider;
}
normalizedProvidersMap.set(provider.key.id, resolvedProvider);
}
}
return normalizedProvidersMap;
}
exports.mergeResolvedProviders = mergeResolvedProviders;
PlatformRef_.prototype._applicationDisposed = function (app) { collection_1.ListWrapper.remove(this._applications, app); };
return PlatformRef_;
AppElement.prototype.detachView = function (viewIndex) {
var view = collection_1.ListWrapper.removeAt(this.nestedViews, viewIndex);
if (view.type === view_type_1.ViewType.COMPONENT) {
throw new exceptions_1.BaseException("Component views can't be moved!");
}
view.renderer.detachView(view.flatRootNodes);
view.removeFromContentChildren(this);
return view;
};
return AppElement;
this._methods.set(methodName, function (message) {
var serializedArgs = message.args;
var numArgs = signature === null ? 0 : signature.length;
var deserializedArgs = collection_1.ListWrapper.createFixedSize(numArgs);
for (var i = 0; i < numArgs; i++) {
var serializedArg = serializedArgs[i];
deserializedArgs[i] = _this._serializer.deserialize(serializedArg, signature[i]);
}
var promise = lang_1.FunctionWrapper.apply(method, deserializedArgs);
if (lang_1.isPresent(returnType) && lang_1.isPresent(promise)) {
_this._wrapWebWorkerPromise(message.id, promise, returnType);
}
});
};