fix(compiler): minor cleanups and fixes

Part of #3605
This commit is contained in:
Tobias Bosch
2015-09-18 10:33:23 -07:00
parent 9c9769047d
commit 0ed6fc4f6b
4 changed files with 25 additions and 8 deletions

View File

@ -41,12 +41,10 @@ export class ChangeDetectionCompiler {
}
private _createChangeDetectorFactory(definition: ChangeDetectorDefinition): Function {
if (IS_DART) {
if (IS_DART || !this._genConfig.useJit) {
var proto = new DynamicProtoChangeDetector(definition);
return (dispatcher) => proto.instantiate(dispatcher);
} else {
// TODO(tbosch): provide a flag in _genConfig whether to allow eval or fall back to dynamic
// change detection as well!
return new ChangeDetectorJITGenerator(definition, UTIL, ABSTRACT_CHANGE_DETECTOR).generate();
}
}

View File

@ -35,6 +35,10 @@ export class TemplateCompiler {
normalizeDirectiveMetadata(directive:
CompileDirectiveMetadata): Promise<CompileDirectiveMetadata> {
if (!directive.isComponent) {
// For non components there is nothing to be normalized yet.
return PromiseWrapper.resolve(directive);
}
var normalizedTemplatePromise;
if (directive.isComponent) {
normalizedTemplatePromise =