Socket
Socket
Sign inDemoInstall

@angular/compiler

Package Overview
Dependencies
Maintainers
1
Versions
843
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/compiler - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

27

bundles/compiler-testing.umd.js
/**
* @license Angular v2.0.1
* @license Angular v2.0.2
* (c) 2010-2016 Google, Inc. https://angular.io/

@@ -13,6 +13,8 @@ * License: MIT

var MockSchemaRegistry = (function () {
function MockSchemaRegistry(existingProperties, attrPropMapping, existingElements) {
function MockSchemaRegistry(existingProperties, attrPropMapping, existingElements, invalidProperties, invalidAttributes) {
this.existingProperties = existingProperties;
this.attrPropMapping = attrPropMapping;
this.existingElements = existingElements;
this.invalidProperties = invalidProperties;
this.invalidAttributes = invalidAttributes;
}

@@ -32,2 +34,21 @@ MockSchemaRegistry.prototype.hasProperty = function (tagName, property, schemas) {

MockSchemaRegistry.prototype.getDefaultComponentElementName = function () { return 'ng-component'; };
MockSchemaRegistry.prototype.validateProperty = function (name) {
if (this.invalidProperties.indexOf(name) > -1) {
return { error: true, msg: "Binding to property '" + name + "' is disallowed for security reasons" };
}
else {
return { error: false };
}
};
MockSchemaRegistry.prototype.validateAttribute = function (name) {
if (this.invalidAttributes.indexOf(name) > -1) {
return {
error: true,
msg: "Binding to attribute '" + name + "' is disallowed for security reasons"
};
}
else {
return { error: false };
}
};
return MockSchemaRegistry;

@@ -54,3 +75,3 @@ }());

var newLineIndex = res.indexOf('\n');
return (newLineIndex === -1) ? res : res.substring(0, newLineIndex);
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
}

@@ -57,0 +78,0 @@ var NumberWrapper = (function () {

4

package.json
{
"name": "@angular/compiler",
"version": "2.0.1",
"version": "2.0.2",
"description": "Angular - the compiler library",

@@ -11,3 +11,3 @@ "main": "bundles/compiler.umd.js",

"peerDependencies": {
"@angular/core": "2.0.1"
"@angular/core": "2.0.2"
},

@@ -14,0 +14,0 @@ "repository": {

@@ -1,33 +0,11 @@

/**
* @license
* Copyright Google Inc. 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
*/
import { CompileDirectiveMetadata } from '../compile_metadata';
import * as o from '../output/output_ast';
import { AnimationOutput } from '../private_import_core';
import * as t from '../template_parser/template_ast';
import { AnimationParseError } from './animation_parser';
export declare class CompiledAnimationTriggerResult {
import { AnimationEntryAst } from './animation_ast';
export declare class AnimationEntryCompileResult {
name: string;
statesMapStatement: o.Statement;
statesVariableName: string;
fnStatement: o.Statement;
fnVariable: o.Expression;
constructor(name: string, statesMapStatement: o.Statement, statesVariableName: string, fnStatement: o.Statement, fnVariable: o.Expression);
statements: o.Statement[];
fnExp: o.Expression;
constructor(name: string, statements: o.Statement[], fnExp: o.Expression);
}
export declare class CompiledComponentAnimationResult {
outputs: AnimationOutput[];
triggers: CompiledAnimationTriggerResult[];
constructor(outputs: AnimationOutput[], triggers: CompiledAnimationTriggerResult[]);
}
export declare class AnimationCompiler {
compileComponent(component: CompileDirectiveMetadata, template: t.TemplateAst[]): CompiledComponentAnimationResult;
compile(factoryNamePrefix: string, parsedAnimations: AnimationEntryAst[]): AnimationEntryCompileResult[];
}
export declare class AnimationPropertyValidationOutput {
outputs: AnimationOutput[];
errors: AnimationParseError[];
constructor(outputs: AnimationOutput[], errors: AnimationParseError[]);
}

@@ -8,64 +8,24 @@ /**

*/
import { StringMapWrapper } from '../facade/collection';
import { isBlank, isPresent } from '../facade/lang';
import { isPresent } from '../facade/lang';
import { Identifiers, resolveIdentifier } from '../identifiers';
import * as o from '../output/output_ast';
import { ANY_STATE, DEFAULT_STATE, EMPTY_STATE } from '../private_import_core';
import * as t from '../template_parser/template_ast';
import { AnimationStepAst } from './animation_ast';
import { AnimationParseError, parseAnimationEntry, parseAnimationOutputName } from './animation_parser';
var animationCompilationCache = new Map();
export var CompiledAnimationTriggerResult = (function () {
function CompiledAnimationTriggerResult(name, statesMapStatement, statesVariableName, fnStatement, fnVariable) {
export var AnimationEntryCompileResult = (function () {
function AnimationEntryCompileResult(name, statements, fnExp) {
this.name = name;
this.statesMapStatement = statesMapStatement;
this.statesVariableName = statesVariableName;
this.fnStatement = fnStatement;
this.fnVariable = fnVariable;
this.statements = statements;
this.fnExp = fnExp;
}
return CompiledAnimationTriggerResult;
return AnimationEntryCompileResult;
}());
export var CompiledComponentAnimationResult = (function () {
function CompiledComponentAnimationResult(outputs, triggers) {
this.outputs = outputs;
this.triggers = triggers;
}
return CompiledComponentAnimationResult;
}());
export var AnimationCompiler = (function () {
function AnimationCompiler() {
}
AnimationCompiler.prototype.compileComponent = function (component, template) {
var compiledAnimations = [];
var groupedErrors = [];
var triggerLookup = {};
var componentName = component.type.name;
component.template.animations.forEach(function (entry) {
var result = parseAnimationEntry(entry);
var triggerName = entry.name;
if (result.errors.length > 0) {
var errorMessage = "Unable to parse the animation sequence for \"" + triggerName + "\" due to the following errors:";
result.errors.forEach(function (error) { errorMessage += '\n-- ' + error.msg; });
groupedErrors.push(errorMessage);
}
if (triggerLookup[triggerName]) {
groupedErrors.push("The animation trigger \"" + triggerName + "\" has already been registered on \"" + componentName + "\"");
}
else {
var factoryName = componentName + "_" + entry.name;
var visitor = new _AnimationBuilder(triggerName, factoryName);
var compileResult = visitor.build(result.ast);
compiledAnimations.push(compileResult);
triggerLookup[entry.name] = compileResult;
}
AnimationCompiler.prototype.compile = function (factoryNamePrefix, parsedAnimations) {
return parsedAnimations.map(function (entry) {
var factoryName = factoryNamePrefix + "_" + entry.name;
var visitor = new _AnimationBuilder(entry.name, factoryName);
return visitor.build(entry);
});
var validatedProperties = _validateAnimationProperties(compiledAnimations, template);
validatedProperties.errors.forEach(function (error) { groupedErrors.push(error.msg); });
if (groupedErrors.length > 0) {
var errorMessageStr = "Animation parsing for " + component.type.name + " has failed due to the following errors:";
groupedErrors.forEach(function (error) { return errorMessageStr += "\n- " + error; });
throw new Error(errorMessageStr);
}
animationCompilationCache.set(component, compiledAnimations);
return new CompiledComponentAnimationResult(validatedProperties.outputs, compiledAnimations);
};

@@ -100,3 +60,3 @@ return AnimationCompiler;

ast.styles.forEach(function (entry) {
stylesArr.push(o.literalMap(StringMapWrapper.keys(entry).map(function (key) { return [key, o.literal(entry[key])]; })));
stylesArr.push(o.literalMap(Object.keys(entry).map(function (key) { return [key, o.literal(entry[key])]; })));
});

@@ -158,5 +118,3 @@ return o.importExpr(resolveIdentifier(Identifiers.AnimationStyles)).instantiate([

var flatStyles = {};
_getStylesArray(ast).forEach(function (entry) {
StringMapWrapper.forEach(entry, function (value, key) { flatStyles[key] = value; });
});
_getStylesArray(ast).forEach(function (entry) { Object.keys(entry).forEach(function (key) { flatStyles[key] = entry[key]; }); });
context.stateMap.registerState(ast.stateName, flatStyles);

@@ -264,9 +222,8 @@ };

var lookupMap = [];
StringMapWrapper.forEach(context.stateMap.states, function (value, stateName) {
Object.keys(context.stateMap.states).forEach(function (stateName) {
var value = context.stateMap.states[stateName];
var variableValue = EMPTY_MAP;
if (isPresent(value)) {
var styleMap_1 = [];
StringMapWrapper.forEach(value, function (value, key) {
styleMap_1.push([key, o.literal(value)]);
});
Object.keys(value).forEach(function (key) { styleMap_1.push([key, o.literal(value[key])]); });
variableValue = o.literalMap(styleMap_1);

@@ -276,4 +233,5 @@ }

});
var compiledStatesMapExpr = this._statesMapVar.set(o.literalMap(lookupMap)).toDeclStmt();
return new CompiledAnimationTriggerResult(this.animationName, compiledStatesMapExpr, this._statesMapVarName, fnStatement, fnVariable);
var compiledStatesMapStmt = this._statesMapVar.set(o.literalMap(lookupMap)).toDeclStmt();
var statements = [compiledStatesMapStmt, fnStatement];
return new AnimationEntryCompileResult(this.animationName, statements, fnVariable);
};

@@ -303,3 +261,3 @@ return _AnimationBuilder;

var existingEntry = this._states[name];
if (isBlank(existingEntry)) {
if (!existingEntry) {
this._states[name] = value;

@@ -327,3 +285,3 @@ }

var styles2 = _getStylesArray(step.keyframes[1])[0];
return StringMapWrapper.isEmpty(styles1) && StringMapWrapper.isEmpty(styles2);
return Object.keys(styles1).length === 0 && Object.keys(styles2).length === 0;
}

@@ -335,82 +293,2 @@ return false;

}
function _validateAnimationProperties(compiledAnimations, template) {
var visitor = new _AnimationTemplatePropertyVisitor(compiledAnimations);
t.templateVisitAll(visitor, template);
return new AnimationPropertyValidationOutput(visitor.outputs, visitor.errors);
}
export var AnimationPropertyValidationOutput = (function () {
function AnimationPropertyValidationOutput(outputs, errors) {
this.outputs = outputs;
this.errors = errors;
}
return AnimationPropertyValidationOutput;
}());
var _AnimationTemplatePropertyVisitor = (function () {
function _AnimationTemplatePropertyVisitor(animations) {
this.errors = [];
this.outputs = [];
this._animationRegistry = this._buildCompileAnimationLookup(animations);
}
_AnimationTemplatePropertyVisitor.prototype._buildCompileAnimationLookup = function (animations) {
var map = {};
animations.forEach(function (entry) { map[entry.name] = true; });
return map;
};
_AnimationTemplatePropertyVisitor.prototype._validateAnimationInputOutputPairs = function (inputAsts, outputAsts, animationRegistry, isHostLevel) {
var _this = this;
var detectedAnimationInputs = {};
inputAsts.forEach(function (input) {
if (input.type == t.PropertyBindingType.Animation) {
var triggerName = input.name;
if (isPresent(animationRegistry[triggerName])) {
detectedAnimationInputs[triggerName] = true;
}
else {
_this.errors.push(new AnimationParseError("Couldn't find an animation entry for " + triggerName));
}
}
});
outputAsts.forEach(function (output) {
if (output.name[0] == '@') {
var normalizedOutputData = parseAnimationOutputName(output.name.substr(1), _this.errors);
var triggerName = normalizedOutputData.name;
var triggerEventPhase = normalizedOutputData.phase;
if (!animationRegistry[triggerName]) {
_this.errors.push(new AnimationParseError("Couldn't find the corresponding " + (isHostLevel ? 'host-level ' : '') + "animation trigger definition for (@" + triggerName + ")"));
}
else if (!detectedAnimationInputs[triggerName]) {
_this.errors.push(new AnimationParseError("Unable to listen on (@" + triggerName + "." + triggerEventPhase + ") because the animation trigger [@" + triggerName + "] isn't being used on the same element"));
}
else {
_this.outputs.push(normalizedOutputData);
}
}
});
};
_AnimationTemplatePropertyVisitor.prototype.visitElement = function (ast, ctx) {
this._validateAnimationInputOutputPairs(ast.inputs, ast.outputs, this._animationRegistry, false);
var componentOnElement = ast.directives.find(function (directive) { return directive.directive.isComponent; });
if (componentOnElement) {
var cachedComponentAnimations = animationCompilationCache.get(componentOnElement.directive);
if (cachedComponentAnimations) {
this._validateAnimationInputOutputPairs(componentOnElement.hostProperties, componentOnElement.hostEvents, this._buildCompileAnimationLookup(cachedComponentAnimations), true);
}
}
t.templateVisitAll(this, ast.children);
};
_AnimationTemplatePropertyVisitor.prototype.visitEmbeddedTemplate = function (ast, ctx) {
t.templateVisitAll(this, ast.children);
};
_AnimationTemplatePropertyVisitor.prototype.visitEvent = function (ast, ctx) { };
_AnimationTemplatePropertyVisitor.prototype.visitBoundText = function (ast, ctx) { };
_AnimationTemplatePropertyVisitor.prototype.visitText = function (ast, ctx) { };
_AnimationTemplatePropertyVisitor.prototype.visitNgContent = function (ast, ctx) { };
_AnimationTemplatePropertyVisitor.prototype.visitAttr = function (ast, ctx) { };
_AnimationTemplatePropertyVisitor.prototype.visitDirective = function (ast, ctx) { };
_AnimationTemplatePropertyVisitor.prototype.visitReference = function (ast, ctx) { };
_AnimationTemplatePropertyVisitor.prototype.visitVariable = function (ast, ctx) { };
_AnimationTemplatePropertyVisitor.prototype.visitDirectiveProperty = function (ast, ctx) { };
_AnimationTemplatePropertyVisitor.prototype.visitElementProperty = function (ast, ctx) { };
return _AnimationTemplatePropertyVisitor;
}());
//# sourceMappingURL=animation_compiler.js.map

@@ -8,11 +8,10 @@ /**

*/
import { CompileAnimationEntryMetadata } from '../compile_metadata';
import { CompileAnimationEntryMetadata, CompileDirectiveMetadata } from '../compile_metadata';
import { ParseError } from '../parse_util';
import { AnimationOutput } from '../private_import_core';
import { AnimationEntryAst } from './animation_ast';
export declare class AnimationParseError extends ParseError {
constructor(message: any);
constructor(message: string);
toString(): string;
}
export declare class ParsedAnimationResult {
export declare class AnimationEntryParseResult {
ast: AnimationEntryAst;

@@ -22,3 +21,5 @@ errors: AnimationParseError[];

}
export declare function parseAnimationEntry(entry: CompileAnimationEntryMetadata): ParsedAnimationResult;
export declare function parseAnimationOutputName(outputName: string, errors: AnimationParseError[]): AnimationOutput;
export declare class AnimationParser {
parseComponent(component: CompileDirectiveMetadata): AnimationEntryAst[];
parseEntry(entry: CompileAnimationEntryMetadata): AnimationEntryParseResult;
}

@@ -18,3 +18,3 @@ /**

import { ParseError } from '../parse_util';
import { ANY_STATE, AnimationOutput, FILL_STYLE_FLAG } from '../private_import_core';
import { ANY_STATE, FILL_STYLE_FLAG } from '../private_import_core';
import { AnimationEntryAst, AnimationGroupAst, AnimationKeyframeAst, AnimationSequenceAst, AnimationStateDeclarationAst, AnimationStateTransitionAst, AnimationStateTransitionExpression, AnimationStepAst, AnimationStylesAst, AnimationWithStepsAst } from './animation_ast';

@@ -27,3 +27,3 @@ import { StylesCollection } from './styles_collection';

__extends(AnimationParseError, _super);
function AnimationParseError(message /** TODO #9100 */) {
function AnimationParseError(message) {
_super.call(this, null, message);

@@ -34,51 +34,62 @@ }

}(ParseError));
export var ParsedAnimationResult = (function () {
function ParsedAnimationResult(ast, errors) {
export var AnimationEntryParseResult = (function () {
function AnimationEntryParseResult(ast, errors) {
this.ast = ast;
this.errors = errors;
}
return ParsedAnimationResult;
return AnimationEntryParseResult;
}());
export function parseAnimationEntry(entry) {
var errors = [];
var stateStyles = {};
var transitions = [];
var stateDeclarationAsts = [];
entry.definitions.forEach(function (def) {
if (def instanceof CompileAnimationStateDeclarationMetadata) {
_parseAnimationDeclarationStates(def, errors).forEach(function (ast) {
stateDeclarationAsts.push(ast);
stateStyles[ast.stateName] = ast.styles;
});
export var AnimationParser = (function () {
function AnimationParser() {
}
AnimationParser.prototype.parseComponent = function (component) {
var _this = this;
var errors = [];
var componentName = component.type.name;
var animationTriggerNames = new Set();
var asts = component.template.animations.map(function (entry) {
var result = _this.parseEntry(entry);
var ast = result.ast;
var triggerName = ast.name;
if (animationTriggerNames.has(triggerName)) {
result.errors.push(new AnimationParseError("The animation trigger \"" + triggerName + "\" has already been registered for the " + componentName + " component"));
}
else {
animationTriggerNames.add(triggerName);
}
if (result.errors.length > 0) {
var errorMessage_1 = "- Unable to parse the animation sequence for \"" + triggerName + "\" on the " + componentName + " component due to the following errors:";
result.errors.forEach(function (error) { errorMessage_1 += '\n-- ' + error.msg; });
errors.push(errorMessage_1);
}
return ast;
});
if (errors.length > 0) {
var errorString = errors.join('\n');
throw new Error("Animation parse errors:\n" + errorString);
}
else {
transitions.push(def);
}
});
var stateTransitionAsts = transitions.map(function (transDef) { return _parseAnimationStateTransition(transDef, stateStyles, errors); });
var ast = new AnimationEntryAst(entry.name, stateDeclarationAsts, stateTransitionAsts);
return new ParsedAnimationResult(ast, errors);
}
export function parseAnimationOutputName(outputName, errors) {
var values = outputName.split('.');
var name;
var phase = '';
if (values.length > 1) {
name = values[0];
var parsedPhase = values[1];
switch (parsedPhase) {
case 'start':
case 'done':
phase = parsedPhase;
break;
default:
errors.push(new AnimationParseError("The provided animation output phase value \"" + parsedPhase + "\" for \"@" + name + "\" is not supported (use start or done)"));
}
}
else {
name = outputName;
errors.push(new AnimationParseError("The animation trigger output event (@" + name + ") is missing its phase value name (start or done are currently supported)"));
}
return new AnimationOutput(name, phase, outputName);
}
return asts;
};
AnimationParser.prototype.parseEntry = function (entry) {
var errors = [];
var stateStyles = {};
var transitions = [];
var stateDeclarationAsts = [];
entry.definitions.forEach(function (def) {
if (def instanceof CompileAnimationStateDeclarationMetadata) {
_parseAnimationDeclarationStates(def, errors).forEach(function (ast) {
stateDeclarationAsts.push(ast);
stateStyles[ast.stateName] = ast.styles;
});
}
else {
transitions.push(def);
}
});
var stateTransitionAsts = transitions.map(function (transDef) { return _parseAnimationStateTransition(transDef, stateStyles, errors); });
var ast = new AnimationEntryAst(entry.name, stateDeclarationAsts, stateTransitionAsts);
return new AnimationEntryParseResult(ast, errors);
};
return AnimationParser;
}());
function _parseAnimationDeclarationStates(stateMetadata, errors) {

@@ -136,10 +147,2 @@ var styleValues = [];

}
function _fetchSylesFromState(stateName, stateStyles) {
var entry = stateStyles[stateName];
if (isPresent(entry)) {
var styles = entry.styles;
return new CompileAnimationStyleMetadata(0, styles);
}
return null;
}
function _normalizeAnimationEntry(entry) {

@@ -283,5 +286,5 @@ return isArray(entry) ? new CompileAnimationSequenceMetadata(entry) :

styleMetadata.styles.forEach(function (entry) {
StringMapWrapper.forEach(entry, function (value /** TODO #9100 */, prop /** TODO #9100 */) {
Object.keys(entry).forEach(function (prop) {
if (prop != 'offset') {
keyframeStyles[prop] = value;
keyframeStyles[prop] = entry[prop];
}

@@ -319,3 +322,3 @@ });

var styles = entry[1];
StringMapWrapper.forEach(styles, function (value /** TODO #9100 */, prop /** TODO #9100 */) {
Object.keys(styles).forEach(function (prop) {
if (!isPresent(firstKeyframeStyles[prop])) {

@@ -326,10 +329,13 @@ firstKeyframeStyles[prop] = FILL_STYLE_FLAG;

}
for (i = limit - 1; i >= 0; i--) {
var _loop_1 = function() {
var entry = rawKeyframes[i];
var styles = entry[1];
StringMapWrapper.forEach(styles, function (value /** TODO #9100 */, prop /** TODO #9100 */) {
Object.keys(styles).forEach(function (prop) {
if (!isPresent(lastKeyframeStyles[prop])) {
lastKeyframeStyles[prop] = value;
lastKeyframeStyles[prop] = styles[prop];
}
});
};
for (i = limit - 1; i >= 0; i--) {
_loop_1();
}

@@ -354,5 +360,3 @@ return rawKeyframes.map(function (entry) { return new AnimationKeyframeAst(entry[0], new AnimationStylesAst([entry[1]])); });

var map = stylesEntry;
StringMapWrapper.forEach(map, function (value /** TODO #9100 */, prop /** TODO #9100 */) {
collectedStyles.insertAtTime(prop, time, value);
});
Object.keys(map).forEach(function (prop) { collectedStyles.insertAtTime(prop, time, map[prop]); });
});

@@ -411,5 +415,3 @@ previousStyles = entry.styles;

currentTime += playTime;
keyframes.forEach(function (keyframe /** TODO #9100 */) { return keyframe.styles.styles.forEach(function (entry /** TODO #9100 */) { return StringMapWrapper.forEach(entry, function (value /** TODO #9100 */, prop /** TODO #9100 */) {
return collectedStyles.insertAtTime(prop, currentTime, value);
}); }); });
keyframes.forEach(function (keyframe /** TODO #9100 */) { return keyframe.styles.styles.forEach(function (entry /** TODO #9100 */) { return Object.keys(entry).forEach(function (prop) { collectedStyles.insertAtTime(prop, currentTime, entry[prop]); }); }); });
}

@@ -480,3 +482,4 @@ else {

endKeyframe.styles.styles.forEach(function (styleData) {
StringMapWrapper.forEach(styleData, function (val /** TODO #9100 */, prop /** TODO #9100 */) {
Object.keys(styleData).forEach(function (prop) {
var val = styleData[prop];
if (prop == 'offset')

@@ -483,0 +486,0 @@ return;

@@ -14,3 +14,3 @@ /**

import { ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
import { ListWrapper, MapWrapper, StringMapWrapper } from './facade/collection';
import { ListWrapper, MapWrapper } from './facade/collection';
import { isPresent, isStringMap, normalizeBlank, normalizeBool } from './facade/lang';

@@ -299,3 +299,4 @@ import { CssSelector } from './selector';

if (isPresent(host)) {
StringMapWrapper.forEach(host, function (value, key) {
Object.keys(host).forEach(function (key) {
var value = host[key];
var matches = key.match(HOST_REG_EXP);

@@ -302,0 +303,0 @@ if (matches === null) {

@@ -19,3 +19,3 @@ /**

private _extractPublicName(def);
private _merge(dm, inputs, outputs, host, queries, directiveType);
private _merge(directive, inputs, outputs, host, queries, directiveType);
}

@@ -10,8 +10,5 @@ /**

import { StringMapWrapper } from './facade/collection';
import { isPresent, stringify } from './facade/lang';
import { stringify } from './facade/lang';
import { ReflectorReader, reflector } from './private_import_core';
import { splitAtColon } from './util';
function _isDirectiveMetadata(type) {
return type instanceof Directive;
}
/*

@@ -35,5 +32,5 @@ * Resolve a `Type` for {@link Directive}.

var typeMetadata = this._reflector.annotations(resolveForwardRef(type));
if (isPresent(typeMetadata)) {
var metadata = typeMetadata.find(_isDirectiveMetadata);
if (isPresent(metadata)) {
if (typeMetadata) {
var metadata = typeMetadata.find(isDirectiveMetadata);
if (metadata) {
var propertyMetadata = this._reflector.propMetadata(type);

@@ -53,6 +50,6 @@ return this._mergeWithPropertyMetadata(metadata, propertyMetadata, type);

var queries = {};
StringMapWrapper.forEach(propertyMetadata, function (metadata, propName) {
metadata.forEach(function (a) {
Object.keys(propertyMetadata).forEach(function (propName) {
propertyMetadata[propName].forEach(function (a) {
if (a instanceof Input) {
if (isPresent(a.bindingPropertyName)) {
if (a.bindingPropertyName) {
inputs.push(propName + ": " + a.bindingPropertyName);

@@ -66,3 +63,3 @@ }

var output = a;
if (isPresent(output.bindingPropertyName)) {
if (output.bindingPropertyName) {
outputs.push(propName + ": " + output.bindingPropertyName);

@@ -76,3 +73,3 @@ }

var hostBinding = a;
if (isPresent(hostBinding.hostPropertyName)) {
if (hostBinding.hostPropertyName) {
host[("[" + hostBinding.hostPropertyName + "]")] = propName;

@@ -86,4 +83,4 @@ }

var hostListener = a;
var args = isPresent(hostListener.args) ? hostListener.args.join(', ') : '';
host[("(" + hostListener.eventName + ")")] = propName + "(" + args + ")";
var args = hostListener.args || [];
host[("(" + hostListener.eventName + ")")] = propName + "(" + args.join(',') + ")";
}

@@ -98,7 +95,7 @@ else if (a instanceof Query) {

DirectiveResolver.prototype._extractPublicName = function (def) { return splitAtColon(def, [null, def])[1].trim(); };
DirectiveResolver.prototype._merge = function (dm, inputs, outputs, host, queries, directiveType) {
DirectiveResolver.prototype._merge = function (directive, inputs, outputs, host, queries, directiveType) {
var _this = this;
var mergedInputs;
if (isPresent(dm.inputs)) {
var inputNames_1 = dm.inputs.map(function (def) { return _this._extractPublicName(def); });
var mergedInputs = inputs;
if (directive.inputs) {
var inputNames_1 = directive.inputs.map(function (def) { return _this._extractPublicName(def); });
inputs.forEach(function (inputDef) {

@@ -110,10 +107,7 @@ var publicName = _this._extractPublicName(inputDef);

});
mergedInputs = dm.inputs.concat(inputs);
mergedInputs.unshift.apply(mergedInputs, directive.inputs);
}
else {
mergedInputs = inputs;
}
var mergedOutputs;
if (isPresent(dm.outputs)) {
var outputNames_1 = dm.outputs.map(function (def) { return _this._extractPublicName(def); });
var mergedOutputs = outputs;
if (directive.outputs) {
var outputNames_1 = directive.outputs.map(function (def) { return _this._extractPublicName(def); });
outputs.forEach(function (outputDef) {

@@ -125,29 +119,26 @@ var publicName = _this._extractPublicName(outputDef);

});
mergedOutputs = dm.outputs.concat(outputs);
mergedOutputs.unshift.apply(mergedOutputs, directive.outputs);
}
else {
mergedOutputs = outputs;
}
var mergedHost = isPresent(dm.host) ? StringMapWrapper.merge(dm.host, host) : host;
var mergedQueries = isPresent(dm.queries) ? StringMapWrapper.merge(dm.queries, queries) : queries;
if (dm instanceof Component) {
var mergedHost = directive.host ? StringMapWrapper.merge(directive.host, host) : host;
var mergedQueries = directive.queries ? StringMapWrapper.merge(directive.queries, queries) : queries;
if (directive instanceof Component) {
return new Component({
selector: dm.selector,
selector: directive.selector,
inputs: mergedInputs,
outputs: mergedOutputs,
host: mergedHost,
exportAs: dm.exportAs,
moduleId: dm.moduleId,
exportAs: directive.exportAs,
moduleId: directive.moduleId,
queries: mergedQueries,
changeDetection: dm.changeDetection,
providers: dm.providers,
viewProviders: dm.viewProviders,
entryComponents: dm.entryComponents,
template: dm.template,
templateUrl: dm.templateUrl,
styles: dm.styles,
styleUrls: dm.styleUrls,
encapsulation: dm.encapsulation,
animations: dm.animations,
interpolation: dm.interpolation
changeDetection: directive.changeDetection,
providers: directive.providers,
viewProviders: directive.viewProviders,
entryComponents: directive.entryComponents,
template: directive.template,
templateUrl: directive.templateUrl,
styles: directive.styles,
styleUrls: directive.styleUrls,
encapsulation: directive.encapsulation,
animations: directive.animations,
interpolation: directive.interpolation
});

@@ -157,9 +148,9 @@ }

return new Directive({
selector: dm.selector,
selector: directive.selector,
inputs: mergedInputs,
outputs: mergedOutputs,
host: mergedHost,
exportAs: dm.exportAs,
exportAs: directive.exportAs,
queries: mergedQueries,
providers: dm.providers
providers: directive.providers
});

@@ -177,2 +168,5 @@ }

}());
function isDirectiveMetadata(type) {
return type instanceof Directive;
}
//# sourceMappingURL=directive_resolver.js.map

@@ -17,20 +17,2 @@ export declare class MapWrapper {

export declare class StringMapWrapper {
static get<V>(map: {
[key: string]: V;
}, key: string): V;
static set<V>(map: {
[key: string]: V;
}, key: string, value: V): void;
static keys(map: {
[key: string]: any;
}): string[];
static values<T>(map: {
[key: string]: T;
}): T[];
static isEmpty(map: {
[key: string]: any;
}): boolean;
static forEach<K, V>(map: {
[key: string]: V;
}, callback: (v: V, K: string) => void): void;
static merge<V>(m1: {

@@ -87,6 +69,1 @@ [key: string]: V;

export declare function iterateListLike(obj: any, fn: Function): void;
export declare class SetWrapper {
static createFromList<T>(lst: T[]): Set<T>;
static has<T>(s: Set<T>, key: T): boolean;
static delete<K>(m: Set<K>, k: K): void;
}

@@ -106,22 +106,2 @@ /**

}
StringMapWrapper.get = function (map, key) {
return map.hasOwnProperty(key) ? map[key] : undefined;
};
StringMapWrapper.set = function (map, key, value) { map[key] = value; };
StringMapWrapper.keys = function (map) { return Object.keys(map); };
StringMapWrapper.values = function (map) {
return Object.keys(map).map(function (k) { return map[k]; });
};
StringMapWrapper.isEmpty = function (map) {
for (var prop in map) {
return false;
}
return true;
};
StringMapWrapper.forEach = function (map, callback) {
for (var _i = 0, _a = Object.keys(map); _i < _a.length; _i++) {
var k = _a[_i];
callback(map[k], k);
}
};
StringMapWrapper.merge = function (m1, m2) {

@@ -320,29 +300,2 @@ var m = {};

}
// Safari and Internet Explorer do not support the iterable parameter to the
// Set constructor. We work around that by manually adding the items.
var createSetFromList = (function () {
var test = new Set([1, 2, 3]);
if (test.size === 3) {
return function createSetFromList(lst) { return new Set(lst); };
}
else {
return function createSetAndPopulateFromList(lst) {
var res = new Set(lst);
if (res.size !== lst.length) {
for (var i = 0; i < lst.length; i++) {
res.add(lst[i]);
}
}
return res;
};
}
})();
export var SetWrapper = (function () {
function SetWrapper() {
}
SetWrapper.createFromList = function (lst) { return createSetFromList(lst); };
SetWrapper.has = function (s, key) { return s.has(key); };
SetWrapper.delete = function (m, k) { m.delete(k); };
return SetWrapper;
}());
//# sourceMappingURL=collection.js.map

@@ -34,4 +34,2 @@

export declare function getTypeNameForDebugging(type: any): string;
export declare var Math: any;
export declare var Date: DateConstructor;
export declare function isPresent(obj: any): boolean;

@@ -50,5 +48,2 @@ export declare function isBlank(obj: any): boolean;

export declare function stringify(token: any): string;
export declare function serializeEnum(val: any): number;
export declare function deserializeEnum(val: any, values: Map<number, any>): any;
export declare function resolveEnumToken(enumValue: any, val: any): string;
export declare class StringWrapper {

@@ -100,10 +95,2 @@ static fromCharCode(code: number): string;

}
export declare class DateWrapper {
static create(year: number, month?: number, day?: number, hour?: number, minutes?: number, seconds?: number, milliseconds?: number): Date;
static fromISOString(str: string): Date;
static fromMillis(ms: number): Date;
static toMillis(date: Date): number;
static now(): Date;
static toJson(date: Date): string;
}
export declare function setValueOnPath(global: any, path: string, value: any): void;

@@ -110,0 +97,0 @@ export declare function getSymbolIterator(): string | symbol;

@@ -29,9 +29,4 @@ /**

export function getTypeNameForDebugging(type) {
if (type['name']) {
return type['name'];
}
return typeof type;
return type['name'] || typeof type;
}
export var Math = _global.Math;
export var Date = _global.Date;
// TODO: remove calls to assert in production environment

@@ -93,15 +88,4 @@ // Note: Can't just export this and import in in other files

var newLineIndex = res.indexOf('\n');
return (newLineIndex === -1) ? res : res.substring(0, newLineIndex);
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
}
// serialize / deserialize enum exist only for consistency with dart API
// enums in typescript don't need to be serialized
export function serializeEnum(val) {
return val;
}
export function deserializeEnum(val, values) {
return val;
}
export function resolveEnumToken(enumValue, val) {
return enumValue[val];
}
export var StringWrapper = (function () {

@@ -268,21 +252,2 @@ function StringWrapper() {

}());
export var DateWrapper = (function () {
function DateWrapper() {
}
DateWrapper.create = function (year, month, day, hour, minutes, seconds, milliseconds) {
if (month === void 0) { month = 1; }
if (day === void 0) { day = 1; }
if (hour === void 0) { hour = 0; }
if (minutes === void 0) { minutes = 0; }
if (seconds === void 0) { seconds = 0; }
if (milliseconds === void 0) { milliseconds = 0; }
return new Date(year, month - 1, day, hour, minutes, seconds, milliseconds);
};
DateWrapper.fromISOString = function (str) { return new Date(str); };
DateWrapper.fromMillis = function (ms) { return new Date(ms); };
DateWrapper.toMillis = function (date) { return date.getTime(); };
DateWrapper.now = function () { return new Date(); };
DateWrapper.toJson = function (date) { return date.toJSON(); };
return DateWrapper;
}());
export function setValueOnPath(global, path, value) {

@@ -289,0 +254,0 @@ var parts = path.split('.');

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"Math":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"Date":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBoolean":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":87,"character":9},"right":"boolean"}},"isNumber":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":91,"character":9},"right":"number"}},"isString":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":95,"character":9},"right":"string"}},"isFunction":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":99,"character":9},"right":"function"}},"isType":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isFunction"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":107,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isStringMap"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isArray":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Array"},"member":"isArray"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"serializeEnum":{"__symbolic":"function","parameters":["val"],"value":{"__symbolic":"reference","name":"val"}},"deserializeEnum":{"__symbolic":"function","parameters":["val","values"],"value":{"__symbolic":"reference","name":"val"}},"resolveEnumToken":{"__symbolic":"function","parameters":["enumValue","val"],"value":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"enumValue"},"index":{"__symbolic":"reference","name":"val"}}},"RegExp":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":287,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":287,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"getMapKey":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"reference","name":"value"}},"normalizeBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":null,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"normalizeBool":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":false,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":305,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":305,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"hasConstructor":{"__symbolic":"function","parameters":["value","type"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"constructor"},"right":{"__symbolic":"reference","name":"type"}}},"escape":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":402,"character":19}}}}
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":61,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBoolean":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":80,"character":9},"right":"boolean"}},"isNumber":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":84,"character":9},"right":"number"}},"isString":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":88,"character":9},"right":"string"}},"isFunction":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":92,"character":9},"right":"function"}},"isType":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isFunction"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":100,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isStringMap"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isArray":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Array"},"member":"isArray"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"RegExp":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":265,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":265,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"getMapKey":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"reference","name":"value"}},"normalizeBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":null,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"normalizeBool":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":false,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":283,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":283,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"hasConstructor":{"__symbolic":"function","parameters":["value","type"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"constructor"},"right":{"__symbolic":"reference","name":"type"}}},"escape":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":367,"character":19}}}}

@@ -22,6 +22,2 @@ /**

var _UNIT_TAG = 'trans-unit';
var _CR = function (ws) {
if (ws === void 0) { ws = 0; }
return new xml.Text("\n" + new Array(ws).join(' '));
};
// http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html

@@ -40,16 +36,18 @@ // http://docs.oasis-open.org/xliff/v1.2/xliff-profile-html/xliff-profile-html-1.2.html

var transUnit = new xml.Tag(_UNIT_TAG, { id: id, datatype: 'html' });
transUnit.children.push(_CR(8), new xml.Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes)), _CR(8), new xml.Tag(_TARGET_TAG));
transUnit.children.push(new xml.CR(8), new xml.Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes)), new xml.CR(8), new xml.Tag(_TARGET_TAG));
if (message.description) {
transUnit.children.push(_CR(8), new xml.Tag('note', { priority: '1', from: 'description' }, [new xml.Text(message.description)]));
transUnit.children.push(new xml.CR(8), new xml.Tag('note', { priority: '1', from: 'description' }, [new xml.Text(message.description)]));
}
if (message.meaning) {
transUnit.children.push(_CR(8), new xml.Tag('note', { priority: '1', from: 'meaning' }, [new xml.Text(message.meaning)]));
transUnit.children.push(new xml.CR(8), new xml.Tag('note', { priority: '1', from: 'meaning' }, [new xml.Text(message.meaning)]));
}
transUnit.children.push(_CR(6));
transUnits.push(_CR(6), transUnit);
transUnit.children.push(new xml.CR(6));
transUnits.push(new xml.CR(6), transUnit);
});
var body = new xml.Tag('body', {}, transUnits.concat([_CR(4)]));
var file = new xml.Tag('file', { 'source-language': _SOURCE_LANG, datatype: 'plaintext', original: 'ng2.template' }, [_CR(4), body, _CR(2)]);
var xliff = new xml.Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [_CR(2), file, _CR()]);
return xml.serialize([new xml.Declaration({ version: '1.0', encoding: 'UTF-8' }), _CR(), xliff]);
var body = new xml.Tag('body', {}, transUnits.concat([new xml.CR(4)]));
var file = new xml.Tag('file', { 'source-language': _SOURCE_LANG, datatype: 'plaintext', original: 'ng2.template' }, [new xml.CR(4), body, new xml.CR(2)]);
var xliff = new xml.Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [new xml.CR(2), file, new xml.CR()]);
return xml.serialize([
new xml.Declaration({ version: '1.0', encoding: 'UTF-8' }), new xml.CR(), xliff, new xml.CR()
]);
};

@@ -108,3 +106,4 @@ Xliff.prototype.load = function (content, url, messageBundle) {

_WriteVisitor.prototype.visitTagPlaceholder = function (ph, context) {
var startTagPh = new xml.Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ph.tag });
var ctype = getCtypeForTag(ph.tag);
var startTagPh = new xml.Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ctype });
if (ph.isVoid) {

@@ -114,3 +113,3 @@ // void tags have no children nor closing tags

}
var closeTagPh = new xml.Tag(_PLACEHOLDER_TAG, { id: ph.closeName, ctype: ph.tag });
var closeTagPh = new xml.Tag(_PLACEHOLDER_TAG, { id: ph.closeName, ctype: ctype });
return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);

@@ -236,2 +235,12 @@ };

}());
function getCtypeForTag(tag) {
switch (tag.toLowerCase()) {
case 'br':
return 'lb';
case 'img':
return 'image';
default:
return "x-" + tag;
}
}
//# sourceMappingURL=xliff.js.map

@@ -21,3 +21,2 @@ /**

var rootNode = new xml.Tag(_MESSAGES_TAG);
rootNode.children.push(new xml.Text('\n'));
Object.keys(messageMap).forEach(function (id) {

@@ -32,10 +31,12 @@ var message = messageMap[id];

}
rootNode.children.push(new xml.Text(' '), new xml.Tag(_MESSAGE_TAG, attrs, visitor.serialize(message.nodes)), new xml.Text('\n'));
rootNode.children.push(new xml.CR(2), new xml.Tag(_MESSAGE_TAG, attrs, visitor.serialize(message.nodes)));
});
rootNode.children.push(new xml.CR());
return xml.serialize([
new xml.Declaration({ version: '1.0', encoding: 'UTF-8' }),
new xml.Text('\n'),
new xml.CR(),
new xml.Doctype(_MESSAGES_TAG, _DOCTYPE),
new xml.Text('\n'),
new xml.CR(),
rootNode,
new xml.CR(),
]);

@@ -42,0 +43,0 @@ };

@@ -49,1 +49,4 @@ /**

}
export declare class CR extends Text {
constructor(ws?: number);
}

@@ -8,2 +8,7 @@ /**

*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var _Visitor = (function () {

@@ -81,2 +86,10 @@ function _Visitor() {

}());
export var CR = (function (_super) {
__extends(CR, _super);
function CR(ws) {
if (ws === void 0) { ws = 0; }
_super.call(this, "\n" + new Array(ws + 1).join(' '));
}
return CR;
}(Text));
var _ESCAPED_CHARS = [

@@ -83,0 +96,0 @@ [/&/g, '&amp;'],

@@ -62,3 +62,2 @@ import { CompileIdentifierMetadata, CompileTokenMetadata } from './compile_metadata';

static TRANSLATIONS_FORMAT: IdentifierSpec;
static AnimationOutput: IdentifierSpec;
}

@@ -65,0 +64,0 @@ export declare function resolveIdentifier(identifier: IdentifierSpec): CompileIdentifierMetadata;

@@ -10,3 +10,3 @@ /**

import { CompileIdentifierMetadata, CompileTokenMetadata } from './compile_metadata';
import { AnimationGroupPlayer, AnimationKeyframe, AnimationOutput, AnimationSequencePlayer, AnimationStyles, AppElement, AppView, ChangeDetectorStatus, CodegenComponentFactoryResolver, DebugAppView, DebugContext, EMPTY_ARRAY, EMPTY_MAP, NgModuleInjector, NoOpAnimationPlayer, StaticNodeDebugInfo, TemplateRef_, UNINITIALIZED, ValueUnwrapper, ViewType, ViewUtils, balanceAnimationKeyframes, castByValue, checkBinding, clearStyles, collectAndResolveStyles, devModeEqual, flattenNestedViewRenderNodes, interpolate, prepareFinalAnimationStyles, pureProxy1, pureProxy10, pureProxy2, pureProxy3, pureProxy4, pureProxy5, pureProxy6, pureProxy7, pureProxy8, pureProxy9, reflector, registerModuleFactory, renderStyles } from './private_import_core';
import { AnimationGroupPlayer, AnimationKeyframe, AnimationSequencePlayer, AnimationStyles, AppElement, AppView, ChangeDetectorStatus, CodegenComponentFactoryResolver, DebugAppView, DebugContext, EMPTY_ARRAY, EMPTY_MAP, NgModuleInjector, NoOpAnimationPlayer, StaticNodeDebugInfo, TemplateRef_, UNINITIALIZED, ValueUnwrapper, ViewType, ViewUtils, balanceAnimationKeyframes, castByValue, checkBinding, clearStyles, collectAndResolveStyles, devModeEqual, flattenNestedViewRenderNodes, interpolate, prepareFinalAnimationStyles, pureProxy1, pureProxy10, pureProxy2, pureProxy3, pureProxy4, pureProxy5, pureProxy6, pureProxy7, pureProxy8, pureProxy9, reflector, registerModuleFactory, renderStyles } from './private_import_core';
import { assetUrl } from './util';

@@ -254,7 +254,2 @@ var APP_VIEW_MODULE_URL = assetUrl('core', 'linker/view');

};
Identifiers.AnimationOutput = {
name: 'AnimationOutput',
moduleUrl: assetUrl('core', 'animation/animation_output'),
runtime: AnimationOutput
};
return Identifiers;

@@ -261,0 +256,0 @@ }());

@@ -124,3 +124,3 @@ /**

var expCase = this._parseExpansionCase();
if (isBlank(expCase))
if (!expCase)
return; // error

@@ -148,3 +148,3 @@ cases.push(expCase);

var exp = this._collectExpansionExpTokens(start);
if (isBlank(exp))
if (!exp)
return null;

@@ -151,0 +151,0 @@ var end = this._advance();

@@ -10,3 +10,3 @@ /**

import { CompileDiDependencyMetadata, CompileIdentifierMetadata } from './compile_metadata';
import { isBlank, isPresent } from './facade/lang';
import { isPresent } from './facade/lang';
import { Identifiers, resolveIdentifier, resolveIdentifierToken } from './identifiers';

@@ -159,3 +159,3 @@ import * as o from './output/output_ast';

}
if (isBlank(type)) {
if (!type) {
type = o.DYNAMIC_TYPE;

@@ -191,7 +191,7 @@ }

}
if (isBlank(result)) {
if (!result) {
result = this._instances.get(dep.token.reference);
}
}
if (isBlank(result)) {
if (!result) {
var args = [createDiTokenExpression(dep.token)];

@@ -198,0 +198,0 @@ if (dep.isOptional) {

@@ -28,2 +28,4 @@ import { CompileNgModuleMetadata, StaticSymbol } from './compile_metadata';

private _translationFormat;
private _animationParser;
private _animationCompiler;
constructor(_metadataResolver: CompileMetadataResolver, _directiveNormalizer: DirectiveNormalizer, _templateParser: TemplateParser, _styleCompiler: StyleCompiler, _viewCompiler: ViewCompiler, _ngModuleCompiler: NgModuleCompiler, _outputEmitter: OutputEmitter, _localeId: string, _translationFormat: string);

@@ -30,0 +32,0 @@ analyzeModules(ngModules: StaticSymbol[]): NgModulesSummary;

@@ -8,2 +8,4 @@ /**

*/
import { AnimationCompiler } from './animation/animation_compiler';
import { AnimationParser } from './animation/animation_parser';
import { CompileProviderMetadata, createHostComponentMeta } from './compile_metadata';

@@ -37,2 +39,4 @@ import { Identifiers, resolveIdentifier, resolveIdentifierToken } from './identifiers';

this._translationFormat = _translationFormat;
this._animationParser = new AnimationParser();
this._animationCompiler = new AnimationCompiler();
}

@@ -131,8 +135,11 @@ OfflineCompiler.prototype.analyzeModules = function (ngModules) {

OfflineCompiler.prototype._compileComponent = function (compMeta, directives, pipes, schemas, componentStyles, fileSuffix, targetStatements) {
var parsedAnimations = this._animationParser.parseComponent(compMeta);
var parsedTemplate = this._templateParser.parse(compMeta, compMeta.template.template, directives, pipes, schemas, compMeta.type.name);
var stylesExpr = componentStyles ? o.variable(componentStyles.stylesVar) : o.literalArr([]);
var viewResult = this._viewCompiler.compileComponent(compMeta, parsedTemplate, stylesExpr, pipes);
var compiledAnimations = this._animationCompiler.compile(compMeta.type.name, parsedAnimations);
var viewResult = this._viewCompiler.compileComponent(compMeta, parsedTemplate, stylesExpr, pipes, compiledAnimations);
if (componentStyles) {
targetStatements.push.apply(targetStatements, _resolveStyleStatements(componentStyles, fileSuffix));
}
compiledAnimations.forEach(function (entry) { entry.statements.forEach(function (statement) { targetStatements.push(statement); }); });
targetStatements.push.apply(targetStatements, _resolveViewStatements(viewResult));

@@ -139,0 +146,0 @@ return viewResult.viewFactoryVar;

@@ -13,3 +13,3 @@ /**

};
import { isBlank, isPresent, isString } from '../facade/lang';
import { isPresent, isString } from '../facade/lang';
//// Types

@@ -24,3 +24,3 @@ export var TypeModifier;

this.modifiers = modifiers;
if (isBlank(modifiers)) {
if (!modifiers) {
this.modifiers = [];

@@ -490,3 +490,3 @@ }

this.modifiers = modifiers;
if (isBlank(modifiers)) {
if (!modifiers) {
this.modifiers = [];

@@ -556,3 +556,3 @@ }

this.modifiers = modifiers;
if (isBlank(modifiers)) {
if (!modifiers) {
this.modifiers = [];

@@ -559,0 +559,0 @@ }

@@ -9,3 +9,2 @@ /**

import { CompileIdentifierMetadata } from '../compile_metadata';
import { StringMapWrapper } from '../facade/collection';
import { visitValue } from '../util';

@@ -27,5 +26,3 @@ import * as o from './output_ast';

var entries = [];
StringMapWrapper.forEach(map, function (value, key) {
entries.push([key, visitValue(value, _this, null)]);
});
Object.keys(map).forEach(function (key) { entries.push([key, visitValue(map[key], _this, null)]); });
return o.literalMap(entries, type);

@@ -32,0 +29,0 @@ };

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"convertValueToOutputAst":{"__symbolic":"function","parameters":["value","type"],"value":{"__symbolic":"error","message":"Reference to non-exported class","line":19,"character":0,"context":{"className":"_ValueOutputAstTransformer"}},"defaults":[null,null]}}}
{"__symbolic":"module","version":1,"metadata":{"convertValueToOutputAst":{"__symbolic":"function","parameters":["value","type"],"value":{"__symbolic":"error","message":"Reference to non-exported class","line":18,"character":0,"context":{"className":"_ValueOutputAstTransformer"}},"defaults":[null,null]}}}

@@ -71,4 +71,2 @@ /**

export declare const AnimationStyles: typeof r.AnimationStyles;
export declare type AnimationOutput = typeof r._AnimationOutput;
export declare const AnimationOutput: typeof r.AnimationOutput;
export declare const ANY_STATE: string;

@@ -75,0 +73,0 @@ export declare const DEFAULT_STATE: string;

@@ -11,3 +11,2 @@ /**

export var ChangeDetectorStatus = r.ChangeDetectorStatus;
r.CHANGE_DETECTION_STRATEGY_VALUES;
export var LifecycleHooks = r.LifecycleHooks;

@@ -58,3 +57,2 @@ export var LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES;

export var AnimationStyles = r.AnimationStyles;
export var AnimationOutput = r.AnimationOutput;
export var ANY_STATE = r.ANY_STATE;

@@ -61,0 +59,0 @@ export var DEFAULT_STATE = r.DEFAULT_STATE;

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"isDefaultChangeDetectionStrategy":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"isDefaultChangeDetectionStrategy"},"ChangeDetectorStatus":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ChangeDetectorStatus"},"LifecycleHooks":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"LifecycleHooks"},"LIFECYCLE_HOOKS_VALUES":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"LIFECYCLE_HOOKS_VALUES"},"ReflectorReader":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ReflectorReader"},"AppElement":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AppElement"},"CodegenComponentFactoryResolver":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"CodegenComponentFactoryResolver"},"AppView":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AppView"},"DebugAppView":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"DebugAppView"},"NgModuleInjector":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"NgModuleInjector"},"registerModuleFactory":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"registerModuleFactory"},"ViewType":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ViewType"},"MAX_INTERPOLATION_VALUES":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"MAX_INTERPOLATION_VALUES"},"checkBinding":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"checkBinding"},"flattenNestedViewRenderNodes":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"flattenNestedViewRenderNodes"},"interpolate":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"interpolate"},"ViewUtils":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ViewUtils"},"DebugContext":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"DebugContext"},"StaticNodeDebugInfo":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"StaticNodeDebugInfo"},"devModeEqual":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"devModeEqual"},"UNINITIALIZED":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"UNINITIALIZED"},"ValueUnwrapper":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ValueUnwrapper"},"TemplateRef_":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"TemplateRef_"},"RenderDebugInfo":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"RenderDebugInfo"},"EMPTY_ARRAY":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"EMPTY_ARRAY"},"EMPTY_MAP":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"EMPTY_MAP"},"pureProxy1":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy1"},"pureProxy2":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy2"},"pureProxy3":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy3"},"pureProxy4":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy4"},"pureProxy5":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy5"},"pureProxy6":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy6"},"pureProxy7":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy7"},"pureProxy8":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy8"},"pureProxy9":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy9"},"pureProxy10":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy10"},"castByValue":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"castByValue"},"Console":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"Console"},"reflector":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"reflector"},"Reflector":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"Reflector"},"ReflectionCapabilities":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ReflectionCapabilities"},"NoOpAnimationPlayer":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"NoOpAnimationPlayer"},"AnimationPlayer":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationPlayer"},"AnimationSequencePlayer":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationSequencePlayer"},"AnimationGroupPlayer":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationGroupPlayer"},"AnimationKeyframe":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationKeyframe"},"AnimationStyles":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationStyles"},"AnimationOutput":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationOutput"},"ANY_STATE":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ANY_STATE"},"DEFAULT_STATE":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"DEFAULT_STATE"},"EMPTY_STATE":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"EMPTY_STATE"},"FILL_STYLE_FLAG":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"FILL_STYLE_FLAG"},"prepareFinalAnimationStyles":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"prepareFinalAnimationStyles"},"balanceAnimationKeyframes":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"balanceAnimationKeyframes"},"clearStyles":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"clearStyles"},"collectAndResolveStyles":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"collectAndResolveStyles"},"renderStyles":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"renderStyles"},"ViewMetadata":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ViewMetadata"},"ComponentStillLoadingError":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ComponentStillLoadingError"}}}
{"__symbolic":"module","version":1,"metadata":{"isDefaultChangeDetectionStrategy":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"isDefaultChangeDetectionStrategy"},"ChangeDetectorStatus":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ChangeDetectorStatus"},"LifecycleHooks":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"LifecycleHooks"},"LIFECYCLE_HOOKS_VALUES":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"LIFECYCLE_HOOKS_VALUES"},"ReflectorReader":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ReflectorReader"},"AppElement":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AppElement"},"CodegenComponentFactoryResolver":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"CodegenComponentFactoryResolver"},"AppView":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AppView"},"DebugAppView":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"DebugAppView"},"NgModuleInjector":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"NgModuleInjector"},"registerModuleFactory":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"registerModuleFactory"},"ViewType":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ViewType"},"MAX_INTERPOLATION_VALUES":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"MAX_INTERPOLATION_VALUES"},"checkBinding":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"checkBinding"},"flattenNestedViewRenderNodes":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"flattenNestedViewRenderNodes"},"interpolate":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"interpolate"},"ViewUtils":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ViewUtils"},"DebugContext":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"DebugContext"},"StaticNodeDebugInfo":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"StaticNodeDebugInfo"},"devModeEqual":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"devModeEqual"},"UNINITIALIZED":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"UNINITIALIZED"},"ValueUnwrapper":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ValueUnwrapper"},"TemplateRef_":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"TemplateRef_"},"RenderDebugInfo":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"RenderDebugInfo"},"EMPTY_ARRAY":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"EMPTY_ARRAY"},"EMPTY_MAP":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"EMPTY_MAP"},"pureProxy1":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy1"},"pureProxy2":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy2"},"pureProxy3":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy3"},"pureProxy4":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy4"},"pureProxy5":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy5"},"pureProxy6":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy6"},"pureProxy7":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy7"},"pureProxy8":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy8"},"pureProxy9":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy9"},"pureProxy10":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"pureProxy10"},"castByValue":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"castByValue"},"Console":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"Console"},"reflector":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"reflector"},"Reflector":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"Reflector"},"ReflectionCapabilities":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ReflectionCapabilities"},"NoOpAnimationPlayer":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"NoOpAnimationPlayer"},"AnimationPlayer":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationPlayer"},"AnimationSequencePlayer":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationSequencePlayer"},"AnimationGroupPlayer":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationGroupPlayer"},"AnimationKeyframe":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationKeyframe"},"AnimationStyles":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"AnimationStyles"},"ANY_STATE":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ANY_STATE"},"DEFAULT_STATE":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"DEFAULT_STATE"},"EMPTY_STATE":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"EMPTY_STATE"},"FILL_STYLE_FLAG":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"FILL_STYLE_FLAG"},"prepareFinalAnimationStyles":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"prepareFinalAnimationStyles"},"balanceAnimationKeyframes":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"balanceAnimationKeyframes"},"clearStyles":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"clearStyles"},"collectAndResolveStyles":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"collectAndResolveStyles"},"renderStyles":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"renderStyles"},"ViewMetadata":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ViewMetadata"},"ComponentStillLoadingError":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ComponentStillLoadingError"}}}

@@ -21,3 +21,3 @@ /**

export declare class ProviderElementContext {
private _viewContext;
viewContext: ProviderViewContext;
private _parent;

@@ -33,3 +33,3 @@ private _isViewRoot;

private _hasViewContainer;
constructor(_viewContext: ProviderViewContext, _parent: ProviderElementContext, _isViewRoot: boolean, _directiveAsts: DirectiveAst[], attrs: AttrAst[], refs: ReferenceAst[], _sourceSpan: ParseSourceSpan);
constructor(viewContext: ProviderViewContext, _parent: ProviderElementContext, _isViewRoot: boolean, _directiveAsts: DirectiveAst[], attrs: AttrAst[], refs: ReferenceAst[], _sourceSpan: ParseSourceSpan);
afterElement(): void;

@@ -36,0 +36,0 @@ transformProviders: ProviderAst[];

@@ -43,5 +43,5 @@ /**

export var ProviderElementContext = (function () {
function ProviderElementContext(_viewContext, _parent, _isViewRoot, _directiveAsts, attrs, refs, _sourceSpan) {
function ProviderElementContext(viewContext, _parent, _isViewRoot, _directiveAsts, attrs, refs, _sourceSpan) {
var _this = this;
this._viewContext = _viewContext;
this.viewContext = viewContext;
this._parent = _parent;

@@ -58,3 +58,3 @@ this._isViewRoot = _isViewRoot;

this._allProviders =
_resolveProvidersFromDirectives(directivesMeta, _sourceSpan, _viewContext.errors);
_resolveProvidersFromDirectives(directivesMeta, _sourceSpan, viewContext.errors);
this._contentQueries = _getContentQueries(directivesMeta);

@@ -130,3 +130,3 @@ var queriedTokens = new Map();

}
queries = this._viewContext.viewQueries.get(token.reference);
queries = this.viewContext.viewQueries.get(token.reference);
if (isPresent(queries)) {

@@ -140,6 +140,5 @@ ListWrapper.addAll(result, queries);

var resolvedProvider = this._allProviders.get(token.reference);
if (isBlank(resolvedProvider) ||
((requestingProviderType === ProviderAstType.Directive ||
requestingProviderType === ProviderAstType.PublicService) &&
resolvedProvider.providerType === ProviderAstType.PrivateService) ||
if (!resolvedProvider || ((requestingProviderType === ProviderAstType.Directive ||
requestingProviderType === ProviderAstType.PublicService) &&
resolvedProvider.providerType === ProviderAstType.PrivateService) ||
((requestingProviderType === ProviderAstType.PrivateService ||

@@ -155,3 +154,3 @@ requestingProviderType === ProviderAstType.PublicService) &&

if (isPresent(this._seenProviders.get(token.reference))) {
this._viewContext.errors.push(new ProviderError("Cannot instantiate cyclic dependency! " + token.name, this._sourceSpan));
this.viewContext.errors.push(new ProviderError("Cannot instantiate cyclic dependency! " + token.name, this._sourceSpan));
return null;

@@ -240,3 +239,3 @@ }

if (dep.isSelf) {
if (isBlank(result) && dep.isOptional) {
if (!result && dep.isOptional) {
result = new CompileDiDependencyMetadata({ isValue: true, value: null });

@@ -247,3 +246,3 @@ }

// check parent elements
while (isBlank(result) && isPresent(currElement._parent)) {
while (!result && isPresent(currElement._parent)) {
var prevElement = currElement;

@@ -257,6 +256,6 @@ currElement = currElement._parent;

// check @Host restriction
if (isBlank(result)) {
if (!dep.isHost || this._viewContext.component.type.isHost ||
this._viewContext.component.type.reference === dep.token.reference ||
isPresent(this._viewContext.viewProviders.get(dep.token.reference))) {
if (!result) {
if (!dep.isHost || this.viewContext.component.type.isHost ||
this.viewContext.component.type.reference === dep.token.reference ||
isPresent(this.viewContext.viewProviders.get(dep.token.reference))) {
result = dep;

@@ -271,4 +270,4 @@ }

}
if (isBlank(result)) {
this._viewContext.errors.push(new ProviderError("No provider for " + dep.token.name, this._sourceSpan));
if (!result) {
this.viewContext.errors.push(new ProviderError("No provider for " + dep.token.name, this._sourceSpan));
}

@@ -307,3 +306,3 @@ return result;

var resolvedProvider = this._allProviders.get(token.reference);
if (isBlank(resolvedProvider)) {
if (!resolvedProvider) {
return null;

@@ -400,3 +399,3 @@ }

if (targetProviders === void 0) { targetProviders = null; }
if (isBlank(targetProviders)) {
if (!targetProviders) {
targetProviders = [];

@@ -448,3 +447,3 @@ }

}
if (isBlank(resolvedProvider)) {
if (!resolvedProvider) {
var lifecycleHooks = provider.token.identifier && provider.token.identifier instanceof CompileTypeMetadata ?

@@ -493,3 +492,3 @@ provider.token.identifier.lifecycleHooks :

var entry = map.get(token.reference);
if (isBlank(entry)) {
if (!entry) {
entry = [];

@@ -496,0 +495,0 @@ map.set(token.reference, entry);

@@ -37,2 +37,4 @@ /**

private _compiledNgModuleCache;
private _animationParser;
private _animationCompiler;
constructor(_injector: Injector, _metadataResolver: CompileMetadataResolver, _templateNormalizer: DirectiveNormalizer, _templateParser: TemplateParser, _styleCompiler: StyleCompiler, _viewCompiler: ViewCompiler, _ngModuleCompiler: NgModuleCompiler, _compilerConfig: CompilerConfig);

@@ -39,0 +41,0 @@ injector: Injector;

@@ -9,6 +9,8 @@ /**

import { Compiler, ComponentFactory, Injectable, Injector, ModuleWithComponentFactories } from '@angular/core';
import { AnimationCompiler } from './animation/animation_compiler';
import { AnimationParser } from './animation/animation_parser';
import { ProviderMeta, createHostComponentMeta } from './compile_metadata';
import { CompilerConfig } from './config';
import { DirectiveNormalizer } from './directive_normalizer';
import { isBlank, stringify } from './facade/lang';
import { stringify } from './facade/lang';
import { CompileMetadataResolver } from './metadata_resolver';

@@ -46,2 +48,4 @@ import { NgModuleCompiler } from './ng_module_compiler';

this._compiledNgModuleCache = new Map();
this._animationParser = new AnimationParser();
this._animationCompiler = new AnimationCompiler();
}

@@ -181,3 +185,3 @@ Object.defineProperty(RuntimeCompiler.prototype, "injector", {

var compiledTemplate = this._compiledHostTemplateCache.get(compType);
if (isBlank(compiledTemplate)) {
if (!compiledTemplate) {
var compMeta = this._metadataResolver.getDirectiveMetadata(compType);

@@ -193,3 +197,3 @@ assertComponent(compMeta);

var compiledTemplate = this._compiledTemplateCache.get(compMeta.type.reference);
if (isBlank(compiledTemplate)) {
if (!compiledTemplate) {
assertComponent(compMeta);

@@ -232,4 +236,6 @@ compiledTemplate = new CompiledTemplate(false, compMeta.selector, compMeta.type, ngModule.transitiveModule.directives, ngModule.transitiveModule.pipes, ngModule.schemas, this._templateNormalizer.normalizeDirective(compMeta));

var viewCompMetas = template.viewComponentTypes.map(function (compType) { return _this._assertComponentLoaded(compType, false).normalizedCompMeta; });
var parsedAnimations = this._animationParser.parseComponent(compMeta);
var parsedTemplate = this._templateParser.parse(compMeta, compMeta.template.template, template.viewDirectives.concat(viewCompMetas), template.viewPipes, template.schemas, compMeta.type.name);
var compileResult = this._viewCompiler.compileComponent(compMeta, parsedTemplate, ir.variable(stylesCompileResult.componentStylesheet.stylesVar), template.viewPipes);
var compiledAnimations = this._animationCompiler.compile(compMeta.type.name, parsedAnimations);
var compileResult = this._viewCompiler.compileComponent(compMeta, parsedTemplate, ir.variable(stylesCompileResult.componentStylesheet.stylesVar), template.viewPipes, compiledAnimations);
compileResult.dependencies.forEach(function (dep) {

@@ -251,2 +257,3 @@ var depTemplate;

var statements = stylesCompileResult.componentStylesheet.statements.concat(compileResult.statements);
compiledAnimations.forEach(function (entry) { entry.statements.forEach(function (statement) { statements.push(statement); }); });
var factory;

@@ -253,0 +260,0 @@ if (!this._compilerConfig.useJit) {

@@ -28,2 +28,10 @@ /**

getDefaultComponentElementName(): string;
validateProperty(name: string): {
error: boolean;
msg?: string;
};
validateAttribute(name: string): {
error: boolean;
msg?: string;
};
}

@@ -331,2 +331,24 @@ /**

DomElementSchemaRegistry.prototype.getDefaultComponentElementName = function () { return 'ng-component'; };
DomElementSchemaRegistry.prototype.validateProperty = function (name) {
if (name.toLowerCase().startsWith('on')) {
var msg = ("Binding to event property '" + name + "' is disallowed for security reasons, ") +
("please use (" + name.slice(2) + ")=...") +
("\nIf '" + name + "' is a directive input, make sure the directive is imported by the") +
" current module.";
return { error: true, msg: msg };
}
else {
return { error: false };
}
};
DomElementSchemaRegistry.prototype.validateAttribute = function (name) {
if (name.toLowerCase().startsWith('on')) {
var msg = ("Binding to event attribute '" + name + "' is disallowed for security reasons, ") +
("please use (" + name.slice(2) + ")=...");
return { error: true, msg: msg };
}
else {
return { error: false };
}
};
DomElementSchemaRegistry.decorators = [

@@ -333,0 +355,0 @@ { type: Injectable },

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"DomElementSchemaRegistry":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"hasProperty":[{"__symbolic":"method"}],"hasElement":[{"__symbolic":"method"}],"securityContext":[{"__symbolic":"method"}],"getMappedPropName":[{"__symbolic":"method"}],"getDefaultComponentElementName":[{"__symbolic":"method"}]}}}}
{"__symbolic":"module","version":1,"metadata":{"DomElementSchemaRegistry":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"hasProperty":[{"__symbolic":"method"}],"hasElement":[{"__symbolic":"method"}],"securityContext":[{"__symbolic":"method"}],"getMappedPropName":[{"__symbolic":"method"}],"getDefaultComponentElementName":[{"__symbolic":"method"}],"validateProperty":[{"__symbolic":"method"}],"validateAttribute":[{"__symbolic":"method"}]}}}}

@@ -15,2 +15,10 @@ /**

abstract getDefaultComponentElementName(): string;
abstract validateProperty(name: string): {
error: boolean;
msg?: string;
};
abstract validateAttribute(name: string): {
error: boolean;
msg?: string;
};
}

@@ -8,6 +8,3 @@ /**

*/
import { ListWrapper } from './facade/collection';
import { StringWrapper, isBlank, isPresent } from './facade/lang';
import { getHtmlTagDefinition } from './ml_parser/html_tags';
var _EMPTY_ATTR_VALUE = '';
var _SELECTOR_REGEXP = new RegExp('(\\:not\\()|' +

@@ -35,4 +32,4 @@ '([-\\w]+)|' +

var _addResult = function (res, cssSel) {
if (cssSel.notSelectors.length > 0 && isBlank(cssSel.element) &&
ListWrapper.isEmpty(cssSel.classNames) && ListWrapper.isEmpty(cssSel.attrs)) {
if (cssSel.notSelectors.length > 0 && !cssSel.element && cssSel.classNames.length == 0 &&
cssSel.attrs.length == 0) {
cssSel.element = '*';

@@ -47,4 +44,4 @@ }

_SELECTOR_REGEXP.lastIndex = 0;
while (isPresent(match = _SELECTOR_REGEXP.exec(selector))) {
if (isPresent(match[1])) {
while (match = _SELECTOR_REGEXP.exec(selector)) {
if (match[1]) {
if (inNot) {

@@ -57,16 +54,16 @@ throw new Error('Nesting :not is not allowed in a selector');

}
if (isPresent(match[2])) {
if (match[2]) {
current.setElement(match[2]);
}
if (isPresent(match[3])) {
if (match[3]) {
current.addClassName(match[3]);
}
if (isPresent(match[4])) {
if (match[4]) {
current.addAttribute(match[4], match[5]);
}
if (isPresent(match[6])) {
if (match[6]) {
inNot = false;
current = cssSelector;
}
if (isPresent(match[7])) {
if (match[7]) {
if (inNot) {

@@ -105,34 +102,18 @@ throw new Error('Multiple selectors in :not are not supported');

CssSelector.prototype.addAttribute = function (name, value) {
if (value === void 0) { value = _EMPTY_ATTR_VALUE; }
this.attrs.push(name);
if (isPresent(value)) {
value = value.toLowerCase();
}
else {
value = _EMPTY_ATTR_VALUE;
}
this.attrs.push(value);
if (value === void 0) { value = ''; }
this.attrs.push(name, value && value.toLowerCase() || '');
};
CssSelector.prototype.addClassName = function (name) { this.classNames.push(name.toLowerCase()); };
CssSelector.prototype.toString = function () {
var res = '';
if (isPresent(this.element)) {
res += this.element;
var res = this.element || '';
if (this.classNames) {
this.classNames.forEach(function (klass) { return res += "." + klass; });
}
if (isPresent(this.classNames)) {
for (var i = 0; i < this.classNames.length; i++) {
res += '.' + this.classNames[i];
if (this.attrs) {
for (var i = 0; i < this.attrs.length; i += 2) {
var name_1 = this.attrs[i];
var value = this.attrs[i + 1];
res += "[" + name_1 + (value ? '=' + value : '') + "]";
}
}
if (isPresent(this.attrs)) {
for (var i = 0; i < this.attrs.length;) {
var attrName = this.attrs[i++];
var attrValue = this.attrs[i++];
res += '[' + attrName;
if (attrValue.length > 0) {
res += '=' + attrValue;
}
res += ']';
}
}
this.notSelectors.forEach(function (notSelector) { return res += ":not(" + notSelector + ")"; });

@@ -149,8 +130,8 @@ return res;

function SelectorMatcher() {
this._elementMap = new Map();
this._elementPartialMap = new Map();
this._classMap = new Map();
this._classPartialMap = new Map();
this._attrValueMap = new Map();
this._attrValuePartialMap = new Map();
this._elementMap = {};
this._elementPartialMap = {};
this._classMap = {};
this._classPartialMap = {};
this._attrValueMap = {};
this._attrValuePartialMap = {};
this._listContexts = [];

@@ -184,3 +165,3 @@ }

var selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);
if (isPresent(element)) {
if (element) {
var isTerminal = attrs.length === 0 && classNames.length === 0;

@@ -194,6 +175,6 @@ if (isTerminal) {

}
if (isPresent(classNames)) {
for (var index = 0; index < classNames.length; index++) {
var isTerminal = attrs.length === 0 && index === classNames.length - 1;
var className = classNames[index];
if (classNames) {
for (var i = 0; i < classNames.length; i++) {
var isTerminal = attrs.length === 0 && i === classNames.length - 1;
var className = classNames[i];
if (isTerminal) {

@@ -207,24 +188,24 @@ this._addTerminal(matcher._classMap, className, selectable);

}
if (isPresent(attrs)) {
for (var index = 0; index < attrs.length;) {
var isTerminal = index === attrs.length - 2;
var attrName = attrs[index++];
var attrValue = attrs[index++];
if (attrs) {
for (var i = 0; i < attrs.length; i += 2) {
var isTerminal = i === attrs.length - 2;
var name_2 = attrs[i];
var value = attrs[i + 1];
if (isTerminal) {
var terminalMap = matcher._attrValueMap;
var terminalValuesMap = terminalMap.get(attrName);
if (isBlank(terminalValuesMap)) {
terminalValuesMap = new Map();
terminalMap.set(attrName, terminalValuesMap);
var terminalValuesMap = terminalMap[name_2];
if (!terminalValuesMap) {
terminalValuesMap = {};
terminalMap[name_2] = terminalValuesMap;
}
this._addTerminal(terminalValuesMap, attrValue, selectable);
this._addTerminal(terminalValuesMap, value, selectable);
}
else {
var parttialMap = matcher._attrValuePartialMap;
var partialValuesMap = parttialMap.get(attrName);
if (isBlank(partialValuesMap)) {
partialValuesMap = new Map();
parttialMap.set(attrName, partialValuesMap);
var partialMap = matcher._attrValuePartialMap;
var partialValuesMap = partialMap[name_2];
if (!partialValuesMap) {
partialValuesMap = {};
partialMap[name_2] = partialValuesMap;
}
matcher = this._addPartial(partialValuesMap, attrValue);
matcher = this._addPartial(partialValuesMap, value);
}

@@ -235,6 +216,6 @@ }

SelectorMatcher.prototype._addTerminal = function (map, name, selectable) {
var terminalList = map.get(name);
if (isBlank(terminalList)) {
var terminalList = map[name];
if (!terminalList) {
terminalList = [];
map.set(name, terminalList);
map[name] = terminalList;
}

@@ -244,6 +225,6 @@ terminalList.push(selectable);

SelectorMatcher.prototype._addPartial = function (map, name) {
var matcher = map.get(name);
if (isBlank(matcher)) {
var matcher = map[name];
if (!matcher) {
matcher = new SelectorMatcher();
map.set(name, matcher);
map[name] = matcher;
}

@@ -270,5 +251,5 @@ return matcher;

result;
if (isPresent(classNames)) {
for (var index = 0; index < classNames.length; index++) {
var className = classNames[index];
if (classNames) {
for (var i = 0; i < classNames.length; i++) {
var className = classNames[i];
result =

@@ -281,20 +262,19 @@ this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;

}
if (isPresent(attrs)) {
for (var index = 0; index < attrs.length;) {
var attrName = attrs[index++];
var attrValue = attrs[index++];
var terminalValuesMap = this._attrValueMap.get(attrName);
if (!StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) {
result = this._matchTerminal(terminalValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) ||
result;
if (attrs) {
for (var i = 0; i < attrs.length; i += 2) {
var name_3 = attrs[i];
var value = attrs[i + 1];
var terminalValuesMap = this._attrValueMap[name_3];
if (value) {
result =
this._matchTerminal(terminalValuesMap, '', cssSelector, matchedCallback) || result;
}
result = this._matchTerminal(terminalValuesMap, attrValue, cssSelector, matchedCallback) ||
result;
var partialValuesMap = this._attrValuePartialMap.get(attrName);
if (!StringWrapper.equals(attrValue, _EMPTY_ATTR_VALUE)) {
result = this._matchPartial(partialValuesMap, _EMPTY_ATTR_VALUE, cssSelector, matchedCallback) ||
result;
result =
this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;
var partialValuesMap = this._attrValuePartialMap[name_3];
if (value) {
result = this._matchPartial(partialValuesMap, '', cssSelector, matchedCallback) || result;
}
result =
this._matchPartial(partialValuesMap, attrValue, cssSelector, matchedCallback) || result;
this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;
}

@@ -306,11 +286,11 @@ }

SelectorMatcher.prototype._matchTerminal = function (map, name, cssSelector, matchedCallback) {
if (isBlank(map) || isBlank(name)) {
if (!map || typeof name !== 'string') {
return false;
}
var selectables = map.get(name);
var starSelectables = map.get('*');
if (isPresent(starSelectables)) {
var selectables = map[name];
var starSelectables = map['*'];
if (starSelectables) {
selectables = selectables.concat(starSelectables);
}
if (isBlank(selectables)) {
if (!selectables) {
return false;

@@ -320,4 +300,4 @@ }

var result = false;
for (var index = 0; index < selectables.length; index++) {
selectable = selectables[index];
for (var i = 0; i < selectables.length; i++) {
selectable = selectables[i];
result = selectable.finalize(cssSelector, matchedCallback) || result;

@@ -329,7 +309,7 @@ }

SelectorMatcher.prototype._matchPartial = function (map, name, cssSelector, matchedCallback) {
if (isBlank(map) || isBlank(name)) {
if (!map || typeof name !== 'string') {
return false;
}
var nestedSelector = map.get(name);
if (isBlank(nestedSelector)) {
var nestedSelector = map[name];
if (!nestedSelector) {
return false;

@@ -361,10 +341,8 @@ }

var result = true;
if (this.notSelectors.length > 0 &&
(isBlank(this.listContext) || !this.listContext.alreadyMatched)) {
if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {
var notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);
result = !notMatcher.match(cssSelector, null);
}
if (result && isPresent(callback) &&
(isBlank(this.listContext) || !this.listContext.alreadyMatched)) {
if (isPresent(this.listContext)) {
if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {
if (this.listContext) {
this.listContext.alreadyMatched = true;

@@ -371,0 +349,0 @@ }

/**
* @license
* Copyright Google Inc. 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
*/
/**
* This file is a port of shadowCSS from webcomponents.js to TypeScript.

@@ -39,2 +46,2 @@ *

}
export declare function processRules(input: string, ruleCallback: Function): string;
export declare function processRules(input: string, ruleCallback: (rule: CssRule) => CssRule): string;

@@ -8,3 +8,2 @@ /**

*/
import { StringWrapper, isBlank, isPresent } from './facade/lang';
/**

@@ -173,3 +172,9 @@ * This file is a port of shadowCSS from webcomponents.js to TypeScript.

// Difference with webcomponents.js: does not handle comments
return StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe, function (m /** TODO #9100 */) { return m[1] + '{'; });
return cssText.replace(_cssContentNextSelectorRe, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i - 0] = arguments[_i];
}
return m[2] + '{';
});
};

@@ -193,7 +198,9 @@ /*

// Difference with webcomponents.js: does not handle comments
return StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function (m /** TODO #9100 */) {
var rule = m[0];
rule = StringWrapper.replace(rule, m[1], '');
rule = StringWrapper.replace(rule, m[2], '');
return m[3] + rule;
return cssText.replace(_cssContentRuleRe, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i - 0] = arguments[_i];
}
var rule = m[0].replace(m[1], '').replace(m[2], '');
return m[4] + rule;
});

@@ -210,3 +217,4 @@ };

ShadowCss.prototype._scopeCssText = function (cssText, scopeSelector, hostSelector) {
var unscoped = this._extractUnscopedRulesFromCssText(cssText);
var unscopedRules = this._extractUnscopedRulesFromCssText(cssText);
// replace :host and :host-context -shadowcsshost and -shadowcsshost respectively
cssText = this._insertPolyfillHostInCssText(cssText);

@@ -216,6 +224,6 @@ cssText = this._convertColonHost(cssText);

cssText = this._convertShadowDOMSelectors(cssText);
if (isPresent(scopeSelector)) {
if (scopeSelector) {
cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);
}
cssText = cssText + '\n' + unscoped;
cssText = cssText + '\n' + unscopedRules;
return cssText.trim();

@@ -244,5 +252,3 @@ };

while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) {
var rule = m[0];
rule = StringWrapper.replace(rule, m[2], '');
rule = StringWrapper.replace(rule, m[1], m[3]);
var rule = m[0].replace(m[2], '').replace(m[1], m[4]);
r += rule + '\n\n';

@@ -257,3 +263,3 @@ }

*
* scopeName.foo > .bar
* .foo<scopeName> > .bar
*/

@@ -268,3 +274,3 @@ ShadowCss.prototype._convertColonHost = function (cssText) {

*
* scopeName.foo > .bar, .foo scopeName > .bar { }
* .foo<scopeName> > .bar, .foo scopeName > .bar { }
*

@@ -277,3 +283,3 @@ * and

*
* scopeName.foo .bar { ... }
* .foo<scopeName> .bar { ... }
*/

@@ -284,11 +290,15 @@ ShadowCss.prototype._convertColonHostContext = function (cssText) {

ShadowCss.prototype._convertColonRule = function (cssText, regExp, partReplacer) {
// p1 = :host, p2 = contents of (), p3 rest of rule
return StringWrapper.replaceAllMapped(cssText, regExp, function (m /** TODO #9100 */) {
if (isPresent(m[2])) {
var parts = m[2].split(','), r = [];
// m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
return cssText.replace(regExp, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i - 0] = arguments[_i];
}
if (m[2]) {
var parts = m[2].split(',');
var r = [];
for (var i = 0; i < parts.length; i++) {
var p = parts[i];
if (isBlank(p))
var p = parts[i].trim();
if (!p)
break;
p = p.trim();
r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));

@@ -304,3 +314,3 @@ }

ShadowCss.prototype._colonHostContextPartReplacer = function (host, part, suffix) {
if (StringWrapper.contains(part, _polyfillHost)) {
if (part.indexOf(_polyfillHost) > -1) {
return this._colonHostPartReplacer(host, part, suffix);

@@ -313,3 +323,3 @@ }

ShadowCss.prototype._colonHostPartReplacer = function (host, part, suffix) {
return host + StringWrapper.replace(part, _polyfillHost, '') + suffix;
return host + part.replace(_polyfillHost, '') + suffix;
};

@@ -321,3 +331,3 @@ /*

ShadowCss.prototype._convertShadowDOMSelectors = function (cssText) {
return _shadowDOMSelectorsRe.reduce(function (result, pattern) { return StringWrapper.replaceAll(result, pattern, ' '); }, cssText);
return _shadowDOMSelectorsRe.reduce(function (result, pattern) { return result.replace(pattern, ' '); }, cssText);
};

@@ -330,7 +340,8 @@ // change a selector like 'div' to 'name div'

var content = rule.content;
if (rule.selector[0] != '@' || rule.selector.startsWith('@page')) {
if (rule.selector[0] != '@') {
selector =
_this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling);
}
else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports')) {
else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {
content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector);

@@ -368,4 +379,3 @@ }

var rre = /\]/g;
scopeSelector = StringWrapper.replaceAll(scopeSelector, lre, '\\[');
scopeSelector = StringWrapper.replaceAll(scopeSelector, rre, '\\]');
scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');

@@ -382,9 +392,7 @@ };

if (_polyfillHostRe.test(selector)) {
var replaceBy = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector;
selector = StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy);
return StringWrapper.replaceAll(selector, _polyfillHostRe, replaceBy + ' ');
var replaceBy_1 = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector;
return selector.replace(_polyfillHostNoCombinatorRe, function (hnc, selector) { return selector + replaceBy_1; })
.replace(_polyfillHostRe, replaceBy_1 + ' ');
}
else {
return scopeSelector + ' ' + selector;
}
return scopeSelector + ' ' + selector;
};

@@ -406,3 +414,3 @@ // return a selector with [name] suffix on each simple selector

var scopedP = p.trim();
if (scopedP.length == 0) {
if (!scopedP) {
return '';

@@ -425,7 +433,17 @@ }

};
var attrSelectorIndex = 0;
var attrSelectors = [];
// replace attribute selectors with placeholders to avoid issue with white space being treated
// as separator
selector = selector.replace(/\[[^\]]*\]/g, function (attrSelector) {
var replaceBy = "__attr_sel_" + attrSelectorIndex + "__";
attrSelectors.push(attrSelector);
attrSelectorIndex++;
return replaceBy;
});
var scopedSelector = '';
var startIndex = 0;
var res;
var sep = /( |>|\+|~(?!=))\s*/g;
var scopeAfter = selector.indexOf(_polyfillHostNoCombinator);
var scoped = '';
var startIndex = 0;
var res;
while ((res = sep.exec(selector)) !== null) {

@@ -437,6 +455,8 @@ var separator = res[1];

var scopedPart = startIndex >= scopeAfter ? _scopeSelectorPart(part) : part;
scoped += scopedPart + " " + separator + " ";
scopedSelector += scopedPart + " " + separator + " ";
startIndex = sep.lastIndex;
}
return scoped + _scopeSelectorPart(selector.substring(startIndex));
scopedSelector += _scopeSelectorPart(selector.substring(startIndex));
// replace the placeholders with their original values
return scopedSelector.replace(/__attr_sel_(\d+)__/g, function (ph, index) { return attrSelectors[+index]; });
};

@@ -449,5 +469,5 @@ ShadowCss.prototype._insertPolyfillHostInCssText = function (selector) {

}());
var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim;
var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim;
var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim;
var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim;
var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
var _polyfillHost = '-shadowcsshost';

@@ -462,2 +482,3 @@ // note: :host-context pre-processed to -shadowcsshostcontext.

var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
var _shadowDOMSelectorsRe = [

@@ -477,3 +498,3 @@ /::shadow/g,

function stripComments(input) {
return StringWrapper.replaceAllMapped(input, _commentRe, function (_ /** TODO #9100 */) { return ''; });
return input.replace(_commentRe, '');
}

@@ -501,3 +522,7 @@ // all comments except inline source mapping

var nextBlockIndex = 0;
return StringWrapper.replaceAllMapped(inputWithEscapedBlocks.escapedString, _ruleRe, function (m /** TODO #9100 */) {
return inputWithEscapedBlocks.escapedString.replace(_ruleRe, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i - 0] = arguments[_i];
}
var selector = m[2];

@@ -507,5 +532,5 @@ var content = '';

var contentPrefix = '';
if (isPresent(m[4]) && m[4].startsWith('{' + BLOCK_PLACEHOLDER)) {
if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
suffix = m[4].substring(BLOCK_PLACEHOLDER.length + 1);
suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
contentPrefix = '{';

@@ -525,3 +550,3 @@ }

function escapeBlocks(input) {
var inputParts = StringWrapper.split(input, _curlyRe);
var inputParts = input.split(_curlyRe);
var resultParts = [];

@@ -528,0 +553,0 @@ var escapedBlocks = [];

@@ -57,3 +57,4 @@ /**

/**
* A binding for an element property (e.g. `[property]="expression"`).
* A binding for an element property (e.g. `[property]="expression"`) or an animation trigger (e.g.
* `[@trigger]="stateExp"`)
*/

@@ -69,5 +70,7 @@ export declare class BoundElementPropertyAst implements TemplateAst {

visit(visitor: TemplateAstVisitor, context: any): any;
isAnimation: boolean;
}
/**
* A binding for an element event (e.g. `(event)="handler()"`).
* A binding for an element event (e.g. `(event)="handler()"`) or an animation trigger event (e.g.
* `(@trigger.phase)="callback($event)"`).
*/

@@ -77,7 +80,9 @@ export declare class BoundEventAst implements TemplateAst {

target: string;
phase: string;
handler: AST;
sourceSpan: ParseSourceSpan;
constructor(name: string, target: string, handler: AST, sourceSpan: ParseSourceSpan);
constructor(name: string, target: string, phase: string, handler: AST, sourceSpan: ParseSourceSpan);
visit(visitor: TemplateAstVisitor, context: any): any;
fullName: string;
isAnimation: boolean;
}

@@ -84,0 +89,0 @@ /**

@@ -48,3 +48,4 @@ /**

/**
* A binding for an element property (e.g. `[property]="expression"`).
* A binding for an element property (e.g. `[property]="expression"`) or an animation trigger (e.g.
* `[@trigger]="stateExp"`)
*/

@@ -63,11 +64,18 @@ export var BoundElementPropertyAst = (function () {

};
Object.defineProperty(BoundElementPropertyAst.prototype, "isAnimation", {
get: function () { return this.type === PropertyBindingType.Animation; },
enumerable: true,
configurable: true
});
return BoundElementPropertyAst;
}());
/**
* A binding for an element event (e.g. `(event)="handler()"`).
* A binding for an element event (e.g. `(event)="handler()"`) or an animation trigger event (e.g.
* `(@trigger.phase)="callback($event)"`).
*/
export var BoundEventAst = (function () {
function BoundEventAst(name, target, handler, sourceSpan) {
function BoundEventAst(name, target, phase, handler, sourceSpan) {
this.name = name;
this.target = target;
this.phase = phase;
this.handler = handler;

@@ -91,2 +99,7 @@ this.sourceSpan = sourceSpan;

});
Object.defineProperty(BoundEventAst.prototype, "isAnimation", {
get: function () { return !!this.phase; },
enumerable: true,
configurable: true
});
return BoundEventAst;

@@ -93,0 +106,0 @@ }());

@@ -17,4 +17,3 @@ /**

import { Parser } from '../expression_parser/parser';
import { StringMapWrapper } from '../facade/collection';
import { isBlank, isPresent, isString } from '../facade/lang';
import { isPresent, isString } from '../facade/lang';
import { I18NHtmlParser } from '../i18n/i18n_html_parser';

@@ -33,3 +32,3 @@ import { Identifiers, identifierToken, resolveIdentifierToken } from '../identifiers';

import { isStyleUrlResolvable } from '../style_url_resolver';
import { splitAtColon } from '../util';
import { splitAtColon, splitAtPeriod } from '../util';
import { AttrAst, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, DirectiveAst, ElementAst, EmbeddedTemplateAst, NgContentAst, PropertyBindingType, ReferenceAst, TextAst, VariableAst, templateVisitAll } from './template_ast';

@@ -384,2 +383,6 @@ import { PreparsedElementType, preparseElement } from './template_preparser';

parsedElement = new ElementAst(nodeName, attrs, elementProps, events, references, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, children, hasInlineTemplates ? null : ngContentIndex_1, element.sourceSpan);
this._findComponentDirectives(directiveAsts)
.forEach(function (componentDirectiveAst) { return _this._validateElementAnimationInputOutputs(componentDirectiveAst.hostProperties, componentDirectiveAst.hostEvents, componentDirectiveAst.directive.template); });
var componentTemplate = providerContext.viewContext.component.template;
this._validateElementAnimationInputOutputs(elementProps, events, componentTemplate);
}

@@ -398,2 +401,22 @@ if (hasInlineTemplates) {

};
TemplateParseVisitor.prototype._validateElementAnimationInputOutputs = function (inputs, outputs, template) {
var _this = this;
var triggerLookup = new Set();
template.animations.forEach(function (entry) { triggerLookup.add(entry.name); });
var animationInputs = inputs.filter(function (input) { return input.isAnimation; });
animationInputs.forEach(function (input) {
var name = input.name;
if (!triggerLookup.has(name)) {
_this._reportError("Couldn't find an animation entry for \"" + name + "\"", input.sourceSpan);
}
});
outputs.forEach(function (output) {
if (output.isAnimation) {
var found = animationInputs.find(function (input) { return input.name == output.name; });
if (!found) {
_this._reportError("Unable to listen on (@" + output.name + "." + output.phase + ") because the animation trigger [@" + output.name + "] isn't being used on the same element", output.sourceSpan);
}
}
});
};
TemplateParseVisitor.prototype._parseInlineTemplateBinding = function (attr, targetMatchableAttrs, targetProps, targetVars) {

@@ -452,3 +475,3 @@ var templateBindingsSource = null;

else if (bindParts[KW_ON_IDX]) {
this._parseEvent(bindParts[IDENT_KW_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
this._parseEventOrAnimationEvent(bindParts[IDENT_KW_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
}

@@ -460,3 +483,3 @@ else if (bindParts[KW_BINDON_IDX]) {

else if (bindParts[KW_AT_IDX]) {
if (name[0] == '@' && isPresent(value) && value.length > 0) {
if (_isAnimationLabel(name) && isPresent(value) && value.length > 0) {
this._reportError("Assigning animation triggers via @prop=\"exp\" attributes with an expression is invalid." +

@@ -475,3 +498,3 @@ " Use property bindings (e.g. [@prop]=\"exp\") or use an attribute without a value (e.g. @prop) instead.", srcSpan, ParseErrorLevel.FATAL);

else if (bindParts[IDENT_EVENT_IDX]) {
this._parseEvent(bindParts[IDENT_EVENT_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
this._parseEventOrAnimationEvent(bindParts[IDENT_EVENT_IDX], value, srcSpan, targetMatchableAttrs, targetEvents);
}

@@ -505,3 +528,3 @@ }

var animatePropLength = ANIMATE_PROP_PREFIX.length;
var isAnimationProp = name[0] == '@';
var isAnimationProp = _isAnimationLabel(name);
var animationPrefixLength = 1;

@@ -543,12 +566,39 @@ if (name.substring(0, animatePropLength) == ANIMATE_PROP_PREFIX) {

TemplateParseVisitor.prototype._parseAssignmentEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
this._parseEvent(name + "Change", expression + "=$event", sourceSpan, targetMatchableAttrs, targetEvents);
this._parseEventOrAnimationEvent(name + "Change", expression + "=$event", sourceSpan, targetMatchableAttrs, targetEvents);
};
TemplateParseVisitor.prototype._parseEventOrAnimationEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
if (_isAnimationLabel(name)) {
name = name.substr(1);
this._parseAnimationEvent(name, expression, sourceSpan, targetEvents);
}
else {
this._parseEvent(name, expression, sourceSpan, targetMatchableAttrs, targetEvents);
}
};
TemplateParseVisitor.prototype._parseAnimationEvent = function (name, expression, sourceSpan, targetEvents) {
var matches = splitAtPeriod(name, [name, '']);
var eventName = matches[0];
var phase = matches[1].toLowerCase();
if (phase) {
switch (phase) {
case 'start':
case 'done':
var ast = this._parseAction(expression, sourceSpan);
targetEvents.push(new BoundEventAst(eventName, null, phase, ast, sourceSpan));
break;
default:
this._reportError("The provided animation output phase value \"" + phase + "\" for \"@" + eventName + "\" is not supported (use start or done)", sourceSpan);
break;
}
}
else {
this._reportError("The animation trigger output event (@" + eventName + ") is missing its phase value name (start or done are currently supported)", sourceSpan);
}
};
TemplateParseVisitor.prototype._parseEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {
// long format: 'target: eventName'
var parts = splitAtColon(name, [null, name]);
var target = parts[0];
var eventName = parts[1];
var _a = splitAtColon(name, [null, name]), target = _a[0], eventName = _a[1];
var ast = this._parseAction(expression, sourceSpan);
targetMatchableAttrs.push([name, ast.source]);
targetEvents.push(new BoundEventAst(eventName, target, ast, sourceSpan));
targetEvents.push(new BoundEventAst(eventName, target, null, ast, sourceSpan));
// Don't detect directives for event names for now,

@@ -620,3 +670,4 @@ // so don't add the event name to the matchableAttrs

if (hostProps) {
StringMapWrapper.forEach(hostProps, function (expression, propName) {
Object.keys(hostProps).forEach(function (propName) {
var expression = hostProps[propName];
if (isString(expression)) {

@@ -635,5 +686,6 @@ var exprAst = _this._parseBinding(expression, sourceSpan);

if (hostListeners) {
StringMapWrapper.forEach(hostListeners, function (expression, propName) {
Object.keys(hostListeners).forEach(function (propName) {
var expression = hostListeners[propName];
if (isString(expression)) {
_this._parseEvent(propName, expression, sourceSpan, [], targetEventAsts);
_this._parseEventOrAnimationEvent(propName, expression, sourceSpan, [], targetEventAsts);
}

@@ -651,3 +703,3 @@ else {

var prevValue = boundPropsByName_1.get(boundProp.name);
if (isBlank(prevValue) || prevValue.isLiteral) {
if (!prevValue || prevValue.isLiteral) {
// give [a]="b" a higher precedence than a="b" on the same element

@@ -657,3 +709,4 @@ boundPropsByName_1.set(boundProp.name, boundProp);

});
StringMapWrapper.forEach(directiveProperties, function (elProp, dirProp) {
Object.keys(directiveProperties).forEach(function (dirProp) {
var elProp = directiveProperties[dirProp];
var boundProp = boundPropsByName_1.get(elProp);

@@ -677,3 +730,3 @@ // Bindings are optional, so this binding only needs to be set up if an expression is given.

props.forEach(function (prop) {
if (!prop.isLiteral && isBlank(boundDirectivePropsIndex.get(prop.name))) {
if (!prop.isLiteral && !boundDirectivePropsIndex.get(prop.name)) {
boundElementProps.push(_this._createElementPropertyAst(elementName, prop.name, prop.expression, prop.sourceSpan));

@@ -692,3 +745,3 @@ }

var partValue = parts[0];
if (partValue[0] == '@') {
if (_isAnimationLabel(partValue)) {
boundPropertyName = partValue.substr(1);

@@ -702,3 +755,3 @@ bindingType = PropertyBindingType.Animation;

bindingType = PropertyBindingType.Property;
this._assertNoEventBinding(boundPropertyName, sourceSpan, false);
this._validatePropertyOrAttributeName(boundPropertyName, sourceSpan, false);
if (!this._schemaRegistry.hasProperty(elementName, boundPropertyName, this._schemas)) {

@@ -718,3 +771,3 @@ var errorMsg = "Can't bind to '" + boundPropertyName + "' since it isn't a known property of '" + elementName + "'.";

boundPropertyName = parts[1];
this._assertNoEventBinding(boundPropertyName, sourceSpan, true);
this._validatePropertyOrAttributeName(boundPropertyName, sourceSpan, true);
// NB: For security purposes, use the mapped property name, not the attribute name.

@@ -756,23 +809,15 @@ var mapPropName = this._schemaRegistry.getMappedPropName(boundPropertyName);

*/
TemplateParseVisitor.prototype._assertNoEventBinding = function (propName, sourceSpan, isAttr) {
if (propName.toLowerCase().startsWith('on')) {
var msg = ("Binding to event attribute '" + propName + "' is disallowed for security reasons, ") +
("please use (" + propName.slice(2) + ")=...");
if (!isAttr) {
msg +=
("\nIf '" + propName + "' is a directive input, make sure the directive is imported by the") +
" current module.";
}
this._reportError(msg, sourceSpan, ParseErrorLevel.FATAL);
TemplateParseVisitor.prototype._validatePropertyOrAttributeName = function (propName, sourceSpan, isAttr) {
var report = isAttr ? this._schemaRegistry.validateAttribute(propName) :
this._schemaRegistry.validateProperty(propName);
if (report.error) {
this._reportError(report.msg, sourceSpan, ParseErrorLevel.FATAL);
}
};
TemplateParseVisitor.prototype._findComponentDirectives = function (directives) {
return directives.filter(function (directive) { return directive.directive.isComponent; });
};
TemplateParseVisitor.prototype._findComponentDirectiveNames = function (directives) {
var componentTypeNames = [];
directives.forEach(function (directive) {
var typeName = directive.directive.type.name;
if (directive.directive.isComponent) {
componentTypeNames.push(typeName);
}
});
return componentTypeNames;
return this._findComponentDirectives(directives)
.map(function (directive) { return directive.directive.type.name; });
};

@@ -817,3 +862,4 @@ TemplateParseVisitor.prototype._assertOnlyOneComponent = function (directives, sourceSpan) {

directives.forEach(function (directive) {
StringMapWrapper.forEach(directive.directive.outputs, function (eventName) {
Object.keys(directive.directive.outputs).forEach(function (k) {
var eventName = directive.directive.outputs[k];
allDirectiveEvents.add(eventName);

@@ -949,2 +995,5 @@ });

}(RecursiveAstVisitor));
function _isAnimationLabel(name) {
return name[0] == '@';
}
//# sourceMappingURL=template_parser.js.map

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"TEMPLATE_TRANSFORMS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"OpaqueToken"},"arguments":["TemplateTransforms"]},"TemplateParser":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","name":"TEMPLATE_TRANSFORMS"}]}]],"parameters":[{"__symbolic":"reference","module":"../expression_parser/parser","name":"Parser"},{"__symbolic":"reference","module":"../schema/element_schema_registry","name":"ElementSchemaRegistry"},{"__symbolic":"reference","module":"../i18n/i18n_html_parser","name":"I18NHtmlParser"},{"__symbolic":"reference","module":"../private_import_core","name":"Console"},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./template_ast","name":"TemplateAstVisitor"}]}]}],"parse":[{"__symbolic":"method"}],"tryParse":[{"__symbolic":"method"}],"_assertNoReferenceDuplicationOnTemplate":[{"__symbolic":"method"}]}},"splitClasses":{"__symbolic":"function","parameters":["classAttrValue"],"value":{"__symbolic":"error","message":"Expression form not supported","line":1044,"character":37}}}}
{"__symbolic":"module","version":1,"metadata":{"TEMPLATE_TRANSFORMS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"OpaqueToken"},"arguments":["TemplateTransforms"]},"TemplateParser":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","name":"TEMPLATE_TRANSFORMS"}]}]],"parameters":[{"__symbolic":"reference","module":"../expression_parser/parser","name":"Parser"},{"__symbolic":"reference","module":"../schema/element_schema_registry","name":"ElementSchemaRegistry"},{"__symbolic":"reference","module":"../i18n/i18n_html_parser","name":"I18NHtmlParser"},{"__symbolic":"reference","module":"../private_import_core","name":"Console"},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./template_ast","name":"TemplateAstVisitor"}]}]}],"parse":[{"__symbolic":"method"}],"tryParse":[{"__symbolic":"method"}],"_assertNoReferenceDuplicationOnTemplate":[{"__symbolic":"method"}]}},"splitClasses":{"__symbolic":"function","parameters":["classAttrValue"],"value":{"__symbolic":"error","message":"Expression form not supported","line":1114,"character":37}}}}

@@ -13,2 +13,3 @@ /**

export declare function splitAtColon(input: string, defaultValues: string[]): string[];
export declare function splitAtPeriod(input: string, defaultValues: string[]): string[];
export declare function sanitizeIdentifier(name: string): string;

@@ -15,0 +16,0 @@ export declare function visitValue(value: any, visitor: ValueVisitor, context: any): any;

@@ -8,3 +8,2 @@ /**

*/
import { StringMapWrapper } from './facade/collection';
import { StringWrapper, isArray, isBlank, isPresent, isPrimitive, isStrictStringMap } from './facade/lang';

@@ -18,6 +17,12 @@ import * as o from './output/output_ast';

export function splitAtColon(input, defaultValues) {
var colonIndex = input.indexOf(':');
if (colonIndex == -1)
return _splitAt(input, ':', defaultValues);
}
export function splitAtPeriod(input, defaultValues) {
return _splitAt(input, '.', defaultValues);
}
function _splitAt(input, character, defaultValues) {
var characterIndex = input.indexOf(character);
if (characterIndex == -1)
return defaultValues;
return [input.slice(0, colonIndex).trim(), input.slice(colonIndex + 1).trim()];
return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];
}

@@ -51,5 +56,3 @@ export function sanitizeIdentifier(name) {

var result = {};
StringMapWrapper.forEach(map, function (value /** TODO #9100 */, key /** TODO #9100 */) {
result[key] = visitValue(value, _this, context);
});
Object.keys(map).forEach(function (key) { result[key] = visitValue(map[key], _this, context); });
return result;

@@ -56,0 +59,0 @@ };

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"MODULE_SUFFIX":"","camelCaseToDashCase":{"__symbolic":"function","parameters":["input"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":15,"character":4,"context":{"name":"CAMEL_CASE_REGEXP"}}},"sanitizeIdentifier":{"__symbolic":"function","parameters":["name"],"value":{"__symbolic":"error","message":"Expression form not supported","line":29,"character":40}}}}
{"__symbolic":"module","version":1,"metadata":{"MODULE_SUFFIX":"","camelCaseToDashCase":{"__symbolic":"function","parameters":["input"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":14,"character":4,"context":{"name":"CAMEL_CASE_REGEXP"}}},"splitAtColon":{"__symbolic":"function","parameters":["input","defaultValues"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":29,"character":9,"context":{"name":"_splitAt"}}},"splitAtPeriod":{"__symbolic":"function","parameters":["input","defaultValues"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":29,"character":9,"context":{"name":"_splitAt"}}},"sanitizeIdentifier":{"__symbolic":"function","parameters":["name"],"value":{"__symbolic":"error","message":"Expression form not supported","line":36,"character":40}}}}

@@ -14,4 +14,4 @@ /**

import { CompileDiDependencyMetadata, CompileProviderMetadata, CompileTokenMetadata } from '../compile_metadata';
import { ListWrapper, MapWrapper, StringMapWrapper } from '../facade/collection';
import { isBlank, isPresent } from '../facade/lang';
import { ListWrapper, MapWrapper } from '../facade/collection';
import { isPresent } from '../facade/lang';
import { Identifiers, identifierToken, resolveIdentifier, resolveIdentifierToken } from '../identifiers';

@@ -34,3 +34,3 @@ import * as o from '../output/output_ast';

}
CompileNode.prototype.isNull = function () { return isBlank(this.renderNode); };
CompileNode.prototype.isNull = function () { return !this.renderNode; };
CompileNode.prototype.isRootElement = function () { return this.view != this.parent.view; };

@@ -166,3 +166,3 @@ return CompileNode;

});
StringMapWrapper.forEach(this.referenceTokens, function (_, varName) {
Object.keys(this.referenceTokens).forEach(function (varName) {
var token = _this.referenceTokens[varName];

@@ -270,7 +270,7 @@ var varValue;

// constructor content query
if (isBlank(result) && isPresent(dep.query)) {
if (!result && isPresent(dep.query)) {
result = this._addQuery(dep.query, null).queryList;
}
// constructor view query
if (isBlank(result) && isPresent(dep.viewQuery)) {
if (!result && isPresent(dep.viewQuery)) {
result = createQueryList(dep.viewQuery, null, "_viewQuery_" + dep.viewQuery.selectors[0].name + "_" + this.nodeIndex + "_" + this._componentConstructorViewQueryLists.length, this.view);

@@ -281,3 +281,3 @@ this._componentConstructorViewQueryLists.push(result);

// access builtins with special visibility
if (isBlank(result)) {
if (!result) {
if (dep.token.reference ===

@@ -294,3 +294,3 @@ resolveIdentifierToken(Identifiers.ChangeDetectorRef).reference) {

// access regular providers on the element
if (isBlank(result)) {
if (!result) {
var resolvedProvider = this._resolvedProviders.get(dep.token.reference);

@@ -315,14 +315,14 @@ // don't allow directives / public services to access private services.

}
if (isBlank(result) && !dep.isSkipSelf) {
if (!result && !dep.isSkipSelf) {
result = this._getLocalDependency(requestingProviderType, dep);
}
// check parent elements
while (isBlank(result) && !currElement.parent.isNull()) {
while (!result && !currElement.parent.isNull()) {
currElement = currElement.parent;
result = currElement._getLocalDependency(ProviderAstType.PublicService, new CompileDiDependencyMetadata({ token: dep.token }));
}
if (isBlank(result)) {
if (!result) {
result = injectFromViewParentInjector(dep.token, dep.isOptional);
}
if (isBlank(result)) {
if (!result) {
result = o.NULL_EXPR;

@@ -358,3 +358,3 @@ }

}
if (isBlank(type)) {
if (!type) {
type = o.DYNAMIC_TYPE;

@@ -361,0 +361,0 @@ }

@@ -8,3 +8,2 @@ /**

*/
import { isBlank } from '../facade/lang';
import { Identifiers, resolveIdentifier, resolveIdentifierToken } from '../identifiers';

@@ -40,3 +39,3 @@ import * as o from '../output/output_ast';

pipe = compView.purePipes.get(name);
if (isBlank(pipe)) {
if (!pipe) {
pipe = new CompilePipe(compView, meta);

@@ -85,3 +84,3 @@ compView.purePipes.set(name, pipe);

}
if (isBlank(pipeMeta)) {
if (!pipeMeta) {
throw new Error("Illegal state: Could not find pipe " + name + " although the parser should have detected this error!");

@@ -88,0 +87,0 @@ }

@@ -9,3 +9,3 @@ /**

import { ListWrapper } from '../facade/collection';
import { isBlank, isPresent } from '../facade/lang';
import { isPresent } from '../facade/lang';
import { Identifiers, resolveIdentifier } from '../identifiers';

@@ -92,5 +92,3 @@ import * as o from '../output/output_ast';

function mapNestedViews(declarationAppElement, view, expressions) {
var adjustedExpressions = expressions.map(function (expr) {
return o.replaceVarInExpression(o.THIS_EXPR.name, o.variable('nestedView'), expr);
});
var adjustedExpressions = expressions.map(function (expr) { return o.replaceVarInExpression(o.THIS_EXPR.name, o.variable('nestedView'), expr); });
return declarationAppElement.callMethod('mapNestedViews', [

@@ -113,3 +111,3 @@ o.variable(view.className),

var entry = map.get(selector.reference);
if (isBlank(entry)) {
if (!entry) {
entry = [];

@@ -116,0 +114,0 @@ map.set(selector.reference, entry);

@@ -8,3 +8,3 @@ /**

*/
import { CompiledAnimationTriggerResult } from '../animation/animation_compiler';
import { AnimationEntryCompileResult } from '../animation/animation_compiler';
import { CompileDirectiveMetadata, CompilePipeMetadata } from '../compile_metadata';

@@ -25,3 +25,3 @@ import { CompilerConfig } from '../config';

styles: o.Expression;
animations: CompiledAnimationTriggerResult[];
animations: AnimationEntryCompileResult[];
viewIndex: number;

@@ -64,3 +64,3 @@ declarationElement: CompileElement;

componentContext: o.Expression;
constructor(component: CompileDirectiveMetadata, genConfig: CompilerConfig, pipeMetas: CompilePipeMetadata[], styles: o.Expression, animations: CompiledAnimationTriggerResult[], viewIndex: number, declarationElement: CompileElement, templateVariableBindings: string[][]);
constructor(component: CompileDirectiveMetadata, genConfig: CompilerConfig, pipeMetas: CompilePipeMetadata[], styles: o.Expression, animations: AnimationEntryCompileResult[], viewIndex: number, declarationElement: CompileElement, templateVariableBindings: string[][]);
callPipe(name: string, input: o.Expression, args: o.Expression[]): o.Expression;

@@ -67,0 +67,0 @@ getLocal(name: string): o.Expression;

@@ -10,3 +10,3 @@ /**

import { ListWrapper, MapWrapper } from '../facade/collection';
import { isBlank, isPresent } from '../facade/lang';
import { isPresent } from '../facade/lang';
import { Identifiers, resolveIdentifier } from '../identifiers';

@@ -106,3 +106,3 @@ import * as o from '../output/output_ast';

var result = currView.locals.get(name);
while (isBlank(result) && isPresent(currView.declarationElement.view)) {
while (!result && isPresent(currView.declarationElement.view)) {
currView = currView.declarationElement.view;

@@ -109,0 +109,0 @@ result = currView.locals.get(name);

@@ -10,10 +10,4 @@ /**

import * as o from '../output/output_ast';
import { AnimationOutput } from '../private_import_core';
import { BoundEventAst, DirectiveAst } from '../template_parser/template_ast';
import { CompileElement } from './compile_element';
export declare class CompileElementAnimationOutput {
listener: CompileEventListener;
output: AnimationOutput;
constructor(listener: CompileEventListener, output: AnimationOutput);
}
export declare class CompileEventListener {

@@ -23,2 +17,3 @@ compileElement: CompileElement;

eventName: string;
eventPhase: string;
private _method;

@@ -29,9 +24,9 @@ private _hasComponentHostListener;

private _actionResultExprs;
static getOrCreate(compileElement: CompileElement, eventTarget: string, eventName: string, targetEventListeners: CompileEventListener[]): CompileEventListener;
static getOrCreate(compileElement: CompileElement, eventTarget: string, eventName: string, eventPhase: string, targetEventListeners: CompileEventListener[]): CompileEventListener;
methodName: string;
constructor(compileElement: CompileElement, eventTarget: string, eventName: string, listenerIndex: number);
constructor(compileElement: CompileElement, eventTarget: string, eventName: string, eventPhase: string, listenerIndex: number);
addAction(hostEvent: BoundEventAst, directive: CompileDirectiveMetadata, directiveInstance: o.Expression): void;
finishMethod(): void;
listenToRenderer(): void;
listenToAnimation(output: AnimationOutput): void;
listenToAnimation(): void;
listenToDirective(directiveInstance: o.Expression, observablePropName: string): void;

@@ -42,2 +37,1 @@ }

export declare function bindRenderOutputs(eventListeners: CompileEventListener[]): void;
export declare function bindAnimationOutputs(eventListeners: CompileElementAnimationOutput[]): void;

@@ -8,5 +8,4 @@ /**

*/
import { StringMapWrapper } from '../facade/collection';
import { StringWrapper, isBlank, isPresent } from '../facade/lang';
import { Identifiers, identifierToken, resolveIdentifier } from '../identifiers';
import { StringWrapper, isPresent } from '../facade/lang';
import { identifierToken } from '../identifiers';
import * as o from '../output/output_ast';

@@ -17,14 +16,8 @@ import { CompileBinding } from './compile_binding';

import { convertCdStatementToIr } from './expression_converter';
export var CompileElementAnimationOutput = (function () {
function CompileElementAnimationOutput(listener, output) {
this.listener = listener;
this.output = output;
}
return CompileElementAnimationOutput;
}());
export var CompileEventListener = (function () {
function CompileEventListener(compileElement, eventTarget, eventName, listenerIndex) {
function CompileEventListener(compileElement, eventTarget, eventName, eventPhase, listenerIndex) {
this.compileElement = compileElement;
this.eventTarget = eventTarget;
this.eventName = eventName;
this.eventPhase = eventPhase;
this._hasComponentHostListener = false;

@@ -37,6 +30,7 @@ this._actionResultExprs = [];

}
CompileEventListener.getOrCreate = function (compileElement, eventTarget, eventName, targetEventListeners) {
var listener = targetEventListeners.find(function (listener) { return listener.eventTarget == eventTarget && listener.eventName == eventName; });
if (isBlank(listener)) {
listener = new CompileEventListener(compileElement, eventTarget, eventName, targetEventListeners.length);
CompileEventListener.getOrCreate = function (compileElement, eventTarget, eventName, eventPhase, targetEventListeners) {
var listener = targetEventListeners.find(function (listener) { return listener.eventTarget == eventTarget && listener.eventName == eventName &&
listener.eventPhase == eventPhase; });
if (!listener) {
listener = new CompileEventListener(compileElement, eventTarget, eventName, eventPhase, targetEventListeners.length);
targetEventListeners.push(listener);

@@ -101,3 +95,3 @@ }

};
CompileEventListener.prototype.listenToAnimation = function (output) {
CompileEventListener.prototype.listenToAnimation = function () {
var outputListener = o.THIS_EXPR.callMethod('eventHandler', [o.THIS_EXPR.prop(this._methodName).callMethod(o.BuiltinMethod.Bind, [o.THIS_EXPR])]);

@@ -107,7 +101,4 @@ // tie the property callback method to the view animations map

.callMethod('registerAnimationOutput', [
this.compileElement.renderNode,
o.importExpr(resolveIdentifier(Identifiers.AnimationOutput)).instantiate([
o.literal(output.name), o.literal(output.phase)
]),
outputListener
this.compileElement.renderNode, o.literal(this.eventName),
o.literal(this.eventPhase), outputListener
])

@@ -132,3 +123,3 @@ .toStmt();

compileElement.view.bindings.push(new CompileBinding(compileElement, hostEvent));
var listener = CompileEventListener.getOrCreate(compileElement, hostEvent.target, hostEvent.name, eventListeners);
var listener = CompileEventListener.getOrCreate(compileElement, hostEvent.target, hostEvent.name, hostEvent.phase, eventListeners);
listener.addAction(hostEvent, null, null);

@@ -140,3 +131,3 @@ });

compileElement.view.bindings.push(new CompileBinding(compileElement, hostEvent));
var listener = CompileEventListener.getOrCreate(compileElement, hostEvent.target, hostEvent.name, eventListeners);
var listener = CompileEventListener.getOrCreate(compileElement, hostEvent.target, hostEvent.name, hostEvent.phase, eventListeners);
listener.addAction(hostEvent, directiveAst.directive, directiveInstance);

@@ -149,3 +140,4 @@ });

export function bindDirectiveOutputs(directiveAst, directiveInstance, eventListeners) {
StringMapWrapper.forEach(directiveAst.directive.outputs, function (eventName /** TODO #9100 */, observablePropName /** TODO #9100 */) {
Object.keys(directiveAst.directive.outputs).forEach(function (observablePropName) {
var eventName = directiveAst.directive.outputs[observablePropName];
eventListeners.filter(function (listener) { return listener.eventName == eventName; }).forEach(function (listener) {

@@ -157,7 +149,11 @@ listener.listenToDirective(directiveInstance, observablePropName);

export function bindRenderOutputs(eventListeners) {
eventListeners.forEach(function (listener) { return listener.listenToRenderer(); });
eventListeners.forEach(function (listener) {
if (listener.eventPhase) {
listener.listenToAnimation();
}
else {
listener.listenToRenderer();
}
});
}
export function bindAnimationOutputs(eventListeners) {
eventListeners.forEach(function (entry) { entry.listener.listenToAnimation(entry.output); });
}
function convertStmtIntoExpression(stmt) {

@@ -164,0 +160,0 @@ if (stmt instanceof o.ExpressionStatement) {

@@ -9,3 +9,3 @@ /**

import { SecurityContext } from '@angular/core';
import { isBlank, isPresent } from '../facade/lang';
import { isPresent } from '../facade/lang';
import { Identifiers, resolveIdentifier } from '../identifiers';

@@ -25,6 +25,5 @@ import * as o from '../output/output_ast';

}
var _animationViewCheckedFlagMap = new Map();
function bind(view, currValExpr, fieldExpr, parsedExpression, context, actions, method, bindingIndex) {
var checkExpression = convertCdExpressionToIr(view, context, parsedExpression, DetectChangesVars.valUnwrapper, bindingIndex);
if (isBlank(checkExpression.expression)) {
if (!checkExpression.expression) {
// e.g. an empty expression was given

@@ -31,0 +30,0 @@ return;

@@ -8,3 +8,3 @@ /**

*/
import { isBlank, isPresent } from '../facade/lang';
import { isPresent } from '../facade/lang';
import { Identifiers, resolveIdentifier } from '../identifiers';

@@ -74,3 +74,3 @@ import * as o from '../output/output_ast';

var pureProxyId = argCount < Identifiers.pureProxies.length ? Identifiers.pureProxies[argCount] : null;
if (isBlank(pureProxyId)) {
if (!pureProxyId) {
throw new Error("Unsupported number of argument for pure functions: " + argCount);

@@ -77,0 +77,0 @@ }

@@ -1,4 +0,10 @@

import { AnimationOutput } from '../private_import_core';
/**
* @license
* Copyright Google Inc. 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
*/
import { TemplateAst } from '../template_parser/template_ast';
import { CompileView } from './compile_view';
export declare function bindView(view: CompileView, parsedTemplate: TemplateAst[], animationOutputs: AnimationOutput[]): void;
export declare function bindView(view: CompileView, parsedTemplate: TemplateAst[]): void;

@@ -0,7 +1,14 @@

/**
* @license
* Copyright Google Inc. 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
*/
import { templateVisitAll } from '../template_parser/template_ast';
import { CompileElementAnimationOutput, bindAnimationOutputs, bindDirectiveOutputs, bindRenderOutputs, collectEventListeners } from './event_binder';
import { bindDirectiveOutputs, bindRenderOutputs, collectEventListeners } from './event_binder';
import { bindDirectiveAfterContentLifecycleCallbacks, bindDirectiveAfterViewLifecycleCallbacks, bindDirectiveDetectChangesLifecycleCallbacks, bindInjectableDestroyLifecycleCallbacks, bindPipeDestroyLifecycleCallbacks } from './lifecycle_binder';
import { bindDirectiveHostProps, bindDirectiveInputs, bindRenderInputs, bindRenderText } from './property_binder';
export function bindView(view, parsedTemplate, animationOutputs) {
var visitor = new ViewBinderVisitor(view, animationOutputs);
export function bindView(view, parsedTemplate) {
var visitor = new ViewBinderVisitor(view);
templateVisitAll(visitor, parsedTemplate);

@@ -11,9 +18,5 @@ view.pipes.forEach(function (pipe) { bindPipeDestroyLifecycleCallbacks(pipe.meta, pipe.instance, pipe.view); });

var ViewBinderVisitor = (function () {
function ViewBinderVisitor(view, animationOutputs) {
var _this = this;
function ViewBinderVisitor(view) {
this.view = view;
this.animationOutputs = animationOutputs;
this._nodeIndex = 0;
this._animationOutputsMap = {};
animationOutputs.forEach(function (entry) { _this._animationOutputsMap[entry.fullPropertyName] = entry; });
}

@@ -31,22 +34,7 @@ ViewBinderVisitor.prototype.visitBoundText = function (ast, parent) {

ViewBinderVisitor.prototype.visitElement = function (ast, parent) {
var _this = this;
var compileElement = this.view.nodes[this._nodeIndex++];
var eventListeners = [];
var animationEventListeners = [];
collectEventListeners(ast.outputs, ast.directives, compileElement).forEach(function (entry) {
// TODO: figure out how to abstract this `if` statement elsewhere
if (entry.eventName[0] == '@') {
var animationOutputName = entry.eventName.substr(1);
var output = _this._animationOutputsMap[animationOutputName];
// no need to report an error here since the parser will
// have caught the missing animation trigger definition
if (output) {
animationEventListeners.push(new CompileElementAnimationOutput(entry, output));
}
}
else {
eventListeners.push(entry);
}
eventListeners.push(entry);
});
bindAnimationOutputs(animationEventListeners);
bindRenderInputs(ast.inputs, compileElement);

@@ -90,3 +78,3 @@ bindRenderOutputs(eventListeners);

});
bindView(compileElement.embeddedView, ast.children, this.animationOutputs);
bindView(compileElement.embeddedView, ast.children);
return null;

@@ -93,0 +81,0 @@ };

@@ -9,5 +9,4 @@ /**

import { ViewEncapsulation } from '@angular/core';
import { AnimationCompiler } from '../animation/animation_compiler';
import { CompileIdentifierMetadata } from '../compile_metadata';
import { ListWrapper, SetWrapper, StringMapWrapper } from '../facade/collection';
import { ListWrapper } from '../facade/collection';
import { StringWrapper, isPresent } from '../facade/lang';

@@ -62,3 +61,2 @@ import { Identifiers, identifierToken, resolveIdentifier } from '../identifiers';

this.nestedViewCount = 0;
this._animationCompiler = new AnimationCompiler();
}

@@ -236,5 +234,4 @@ ViewBuilderVisitor.prototype._isRootNode = function (parent) { return parent.view !== this.view; };

this.view.nodes.push(compileElement);
var compiledAnimations = this._animationCompiler.compileComponent(this.view.component, [ast]);
this.nestedViewCount++;
var embeddedView = new CompileView(this.view.component, this.view.genConfig, this.view.pipeMetas, o.NULL_EXPR, compiledAnimations.triggers, this.view.viewIndex + this.nestedViewCount, compileElement, templateVariableBindings);
var embeddedView = new CompileView(this.view.component, this.view.genConfig, this.view.pipeMetas, o.NULL_EXPR, this.view.animations, this.view.viewIndex + this.nestedViewCount, compileElement, templateVariableBindings);
this.nestedViewCount += buildView(embeddedView, ast.children, this.targetDependencies);

@@ -291,5 +288,6 @@ compileElement.beforeChildren();

var result = {};
StringMapWrapper.forEach(declaredHtmlAttrs, function (value, key) { result[key] = value; });
Object.keys(declaredHtmlAttrs).forEach(function (key) { result[key] = declaredHtmlAttrs[key]; });
directives.forEach(function (directiveMeta) {
StringMapWrapper.forEach(directiveMeta.hostAttributes, function (value, name) {
Object.keys(directiveMeta.hostAttributes).forEach(function (name) {
var value = directiveMeta.hostAttributes[name];
var prevValue = result[name];

@@ -316,5 +314,3 @@ result[name] = isPresent(prevValue) ? mergeAttributeValue(name, prevValue, value) : value;

var entryArray = [];
StringMapWrapper.forEach(data, function (value, name) {
entryArray.push([name, value]);
});
Object.keys(data).forEach(function (name) { entryArray.push([name, data[name]]); });
// We need to sort to get a defined output order

@@ -352,3 +348,4 @@ // for tests and for caching generated artifacts...

}
StringMapWrapper.forEach(compileElement.referenceTokens, function (token, varName) {
Object.keys(compileElement.referenceTokens).forEach(function (varName) {
var token = compileElement.referenceTokens[varName];
varTokenEntries.push([varName, isPresent(token) ? createDiTokenExpression(token) : o.NULL_EXPR]);

@@ -413,13 +410,12 @@ });

if (view.viewIndex === 0) {
var animationsExpr = o.literalMap(view.animations.map(function (entry) { return [entry.name, entry.fnVariable]; }));
initRenderCompTypeStmts = [new o.IfStmt(renderCompTypeVar.identical(o.NULL_EXPR), [
renderCompTypeVar
var animationsExpr = o.literalMap(view.animations.map(function (entry) { return [entry.name, entry.fnExp]; }));
initRenderCompTypeStmts = [new o.IfStmt(renderCompTypeVar.identical(o.NULL_EXPR), [renderCompTypeVar
.set(ViewConstructorVars.viewUtils.callMethod('createRenderComponentType', [
o.literal(templateUrlInfo),
view.genConfig.genDebugInfo ? o.literal(templateUrlInfo) : o.literal(''),
o.literal(view.component.template.ngContentSelectors.length),
ViewEncapsulationEnum.fromValue(view.component.template.encapsulation), view.styles,
animationsExpr
ViewEncapsulationEnum.fromValue(view.component.template.encapsulation),
view.styles,
animationsExpr,
]))
.toStmt()
])];
.toStmt()])];
}

@@ -484,10 +480,10 @@ return o

var readVars = o.findReadVarNames(stmts);
if (SetWrapper.has(readVars, DetectChangesVars.changed.name)) {
if (readVars.has(DetectChangesVars.changed.name)) {
varStmts.push(DetectChangesVars.changed.set(o.literal(true)).toDeclStmt(o.BOOL_TYPE));
}
if (SetWrapper.has(readVars, DetectChangesVars.changes.name)) {
if (readVars.has(DetectChangesVars.changes.name)) {
varStmts.push(DetectChangesVars.changes.set(o.NULL_EXPR)
.toDeclStmt(new o.MapType(o.importType(resolveIdentifier(Identifiers.SimpleChange)))));
}
if (SetWrapper.has(readVars, DetectChangesVars.valUnwrapper.name)) {
if (readVars.has(DetectChangesVars.valUnwrapper.name)) {
varStmts.push(DetectChangesVars.valUnwrapper

@@ -494,0 +490,0 @@ .set(o.importExpr(resolveIdentifier(Identifiers.ValueUnwrapper)).instantiate([]))

@@ -0,1 +1,2 @@

import { AnimationEntryCompileResult } from '../animation/animation_compiler';
import { CompileDirectiveMetadata, CompilePipeMetadata } from '../compile_metadata';

@@ -17,3 +18,3 @@ import { CompilerConfig } from '../config';

constructor(_genConfig: CompilerConfig);
compileComponent(component: CompileDirectiveMetadata, template: TemplateAst[], styles: o.Expression, pipes: CompilePipeMetadata[]): ViewCompileResult;
compileComponent(component: CompileDirectiveMetadata, template: TemplateAst[], styles: o.Expression, pipes: CompilePipeMetadata[], compiledAnimations: AnimationEntryCompileResult[]): ViewCompileResult;
}

@@ -29,16 +29,10 @@ /**

}
ViewCompiler.prototype.compileComponent = function (component, template, styles, pipes) {
ViewCompiler.prototype.compileComponent = function (component, template, styles, pipes, compiledAnimations) {
var dependencies = [];
var compiledAnimations = this._animationCompiler.compileComponent(component, template);
var view = new CompileView(component, this._genConfig, pipes, styles, compiledAnimations, 0, CompileElement.createNull(), []);
var statements = [];
var animationTriggers = compiledAnimations.triggers;
animationTriggers.forEach(function (entry) {
statements.push(entry.statesMapStatement);
statements.push(entry.fnStatement);
});
var view = new CompileView(component, this._genConfig, pipes, styles, animationTriggers, 0, CompileElement.createNull(), []);
buildView(view, template, dependencies);
// Need to separate binding from creation to be able to refer to
// variables that have been declared after usage.
bindView(view, template, compiledAnimations.outputs);
bindView(view, template);
finishView(view, statements);

@@ -45,0 +39,0 @@ return new ViewCompileResult(statements, view.viewFactory.name, dependencies);

@@ -34,4 +34,2 @@

export declare function getTypeNameForDebugging(type: any): string;
export declare var Math: any;
export declare var Date: DateConstructor;
export declare function isPresent(obj: any): boolean;

@@ -50,5 +48,2 @@ export declare function isBlank(obj: any): boolean;

export declare function stringify(token: any): string;
export declare function serializeEnum(val: any): number;
export declare function deserializeEnum(val: any, values: Map<number, any>): any;
export declare function resolveEnumToken(enumValue: any, val: any): string;
export declare class StringWrapper {

@@ -100,10 +95,2 @@ static fromCharCode(code: number): string;

}
export declare class DateWrapper {
static create(year: number, month?: number, day?: number, hour?: number, minutes?: number, seconds?: number, milliseconds?: number): Date;
static fromISOString(str: string): Date;
static fromMillis(ms: number): Date;
static toMillis(date: Date): number;
static now(): Date;
static toJson(date: Date): string;
}
export declare function setValueOnPath(global: any, path: string, value: any): void;

@@ -110,0 +97,0 @@ export declare function getSymbolIterator(): string | symbol;

@@ -29,9 +29,4 @@ /**

export function getTypeNameForDebugging(type) {
if (type['name']) {
return type['name'];
}
return typeof type;
return type['name'] || typeof type;
}
export var Math = _global.Math;
export var Date = _global.Date;
// TODO: remove calls to assert in production environment

@@ -93,15 +88,4 @@ // Note: Can't just export this and import in in other files

var newLineIndex = res.indexOf('\n');
return (newLineIndex === -1) ? res : res.substring(0, newLineIndex);
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
}
// serialize / deserialize enum exist only for consistency with dart API
// enums in typescript don't need to be serialized
export function serializeEnum(val) {
return val;
}
export function deserializeEnum(val, values) {
return val;
}
export function resolveEnumToken(enumValue, val) {
return enumValue[val];
}
export var StringWrapper = (function () {

@@ -268,21 +252,2 @@ function StringWrapper() {

}());
export var DateWrapper = (function () {
function DateWrapper() {
}
DateWrapper.create = function (year, month, day, hour, minutes, seconds, milliseconds) {
if (month === void 0) { month = 1; }
if (day === void 0) { day = 1; }
if (hour === void 0) { hour = 0; }
if (minutes === void 0) { minutes = 0; }
if (seconds === void 0) { seconds = 0; }
if (milliseconds === void 0) { milliseconds = 0; }
return new Date(year, month - 1, day, hour, minutes, seconds, milliseconds);
};
DateWrapper.fromISOString = function (str) { return new Date(str); };
DateWrapper.fromMillis = function (ms) { return new Date(ms); };
DateWrapper.toMillis = function (date) { return date.getTime(); };
DateWrapper.now = function () { return new Date(); };
DateWrapper.toJson = function (date) { return date.toJSON(); };
return DateWrapper;
}());
export function setValueOnPath(global, path, value) {

@@ -289,0 +254,0 @@ var parts = path.split('.');

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":1,"metadata":{"Math":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"Date":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBoolean":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":87,"character":9},"right":"boolean"}},"isNumber":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":91,"character":9},"right":"number"}},"isString":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":95,"character":9},"right":"string"}},"isFunction":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":99,"character":9},"right":"function"}},"isType":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isFunction"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":107,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isStringMap"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isArray":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Array"},"member":"isArray"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"serializeEnum":{"__symbolic":"function","parameters":["val"],"value":{"__symbolic":"reference","name":"val"}},"deserializeEnum":{"__symbolic":"function","parameters":["val","values"],"value":{"__symbolic":"reference","name":"val"}},"resolveEnumToken":{"__symbolic":"function","parameters":["enumValue","val"],"value":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"enumValue"},"index":{"__symbolic":"reference","name":"val"}}},"RegExp":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":287,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":287,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"getMapKey":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"reference","name":"value"}},"normalizeBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":null,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"normalizeBool":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":false,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":305,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":305,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"hasConstructor":{"__symbolic":"function","parameters":["value","type"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"constructor"},"right":{"__symbolic":"reference","name":"type"}}},"escape":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":402,"character":19}}}}
{"__symbolic":"module","version":1,"metadata":{"getTypeNameForDebugging":{"__symbolic":"function","parameters":["type"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"type"},"index":"name"},"right":{"__symbolic":"error","message":"Expression form not supported","line":61,"character":25}}},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBoolean":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":80,"character":9},"right":"boolean"}},"isNumber":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":84,"character":9},"right":"number"}},"isString":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":88,"character":9},"right":"string"}},"isFunction":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":92,"character":9},"right":"function"}},"isType":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isFunction"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":100,"character":9},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isStringMap"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{}]}}}},"isArray":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Array"},"member":"isArray"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"RegExp":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":265,"character":20},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":265,"character":45},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"getMapKey":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"reference","name":"value"}},"normalizeBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":null,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"normalizeBool":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isBlank"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"thenExpression":false,"elseExpression":{"__symbolic":"reference","name":"obj"}}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":283,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":283,"character":51},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"hasConstructor":{"__symbolic":"function","parameters":["value","type"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"constructor"},"right":{"__symbolic":"reference","name":"type"}}},"escape":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Reference to a local symbol","line":55,"character":4,"context":{"name":"_global"}}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":367,"character":19}}}}

@@ -20,2 +20,4 @@ /**

};
invalidProperties: Array<string>;
invalidAttributes: Array<string>;
constructor(existingProperties: {

@@ -27,3 +29,3 @@ [key: string]: boolean;

[key: string]: boolean;
});
}, invalidProperties: Array<string>, invalidAttributes: Array<string>);
hasProperty(tagName: string, property: string, schemas: SchemaMetadata[]): boolean;

@@ -34,2 +36,10 @@ hasElement(tagName: string, schemaMetas: SchemaMetadata[]): boolean;

getDefaultComponentElementName(): string;
validateProperty(name: string): {
error: boolean;
msg?: string;
};
validateAttribute(name: string): {
error: boolean;
msg?: string;
};
}

@@ -10,6 +10,8 @@ /**

export var MockSchemaRegistry = (function () {
function MockSchemaRegistry(existingProperties, attrPropMapping, existingElements) {
function MockSchemaRegistry(existingProperties, attrPropMapping, existingElements, invalidProperties, invalidAttributes) {
this.existingProperties = existingProperties;
this.attrPropMapping = attrPropMapping;
this.existingElements = existingElements;
this.invalidProperties = invalidProperties;
this.invalidAttributes = invalidAttributes;
}

@@ -29,4 +31,23 @@ MockSchemaRegistry.prototype.hasProperty = function (tagName, property, schemas) {

MockSchemaRegistry.prototype.getDefaultComponentElementName = function () { return 'ng-component'; };
MockSchemaRegistry.prototype.validateProperty = function (name) {
if (this.invalidProperties.indexOf(name) > -1) {
return { error: true, msg: "Binding to property '" + name + "' is disallowed for security reasons" };
}
else {
return { error: false };
}
};
MockSchemaRegistry.prototype.validateAttribute = function (name) {
if (this.invalidAttributes.indexOf(name) > -1) {
return {
error: true,
msg: "Binding to attribute '" + name + "' is disallowed for security reasons"
};
}
else {
return { error: false };
}
};
return MockSchemaRegistry;
}());
//# sourceMappingURL=schema_registry_mock.js.map

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc