fix(Compiler): asynchronous error reporting
This commit is contained in:
parent
2e488f3559
commit
c3873be295
|
@ -199,10 +199,10 @@ export class Compiler {
|
||||||
var protoView = this._compile(ce.componentDirective.type);
|
var protoView = this._compile(ce.componentDirective.type);
|
||||||
|
|
||||||
if (PromiseWrapper.isPromise(protoView)) {
|
if (PromiseWrapper.isPromise(protoView)) {
|
||||||
ListWrapper.push(promises, protoView);
|
ListWrapper.push(
|
||||||
protoView.then(function (protoView) {
|
promises,
|
||||||
ce.inheritedElementBinder.nestedProtoView = protoView;
|
protoView.then(function(pv) { ce.inheritedElementBinder.nestedProtoView = pv;})
|
||||||
});
|
);
|
||||||
} else {
|
} else {
|
||||||
ce.inheritedElementBinder.nestedProtoView = protoView;
|
ce.inheritedElementBinder.nestedProtoView = protoView;
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,19 +229,17 @@ export function runCompilerCommonTests() {
|
||||||
createNestedComponentSpec('(error -> sync)', templateResolver,
|
createNestedComponentSpec('(error -> sync)', templateResolver,
|
||||||
'Failed to load the template for ParentComponent');
|
'Failed to load the template for ParentComponent');
|
||||||
|
|
||||||
// TODO(vicb): Check why errors this fails with Dart
|
templateResolver = new FakeTemplateResolver();
|
||||||
// TODO(vicb): The Promise is rejected with the correct error but an exc is thrown before
|
templateResolver.setSync(ParentComponent);
|
||||||
//templateResolver = new FakeTemplateResolver();
|
templateResolver.setError(NestedComponent);
|
||||||
//templateResolver.setSync(ParentComponent);
|
createNestedComponentSpec('(sync -> error)', templateResolver,
|
||||||
//templateResolver.setError(NestedComponent);
|
'Failed to load the template for NestedComponent -> Failed to compile ParentComponent');
|
||||||
//createNestedComponentSpec('(sync -> error)', templateResolver,
|
|
||||||
// 'Failed to load the template for NestedComponent -> Failed to compile ParentComponent');
|
templateResolver = new FakeTemplateResolver();
|
||||||
//
|
templateResolver.setAsync(ParentComponent);
|
||||||
//templateResolver = new FakeTemplateResolver();
|
templateResolver.setError(NestedComponent);
|
||||||
//templateResolver.setAsync(ParentComponent);
|
createNestedComponentSpec('(async -> error)', templateResolver,
|
||||||
//templateResolver.setError(NestedComponent);
|
'Failed to load the template for NestedComponent -> Failed to compile ParentComponent');
|
||||||
//createNestedComponentSpec('(async -> error)', templateResolver,
|
|
||||||
// 'Failed to load the template for NestedComponent -> Failed to compile ParentComponent');
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue