Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions modules/@angular/core/src/di/reflective_errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ export class AbstractProviderError extends BaseError {
this.keys.push(key);
this.message = this.constructResolvingMessage(this.keys);
}

get context() { return this.injectors[this.injectors.length - 1].debugContext(); }
}

/**
Expand Down Expand Up @@ -174,8 +172,6 @@ export class InstantiationError extends WrappedError {
}

get causeKey(): ReflectiveKey { return this.keys[0]; }

get context() { return this.injectors[this.injectors.length - 1].debugContext(); }
}

/**
Expand Down
15 changes: 1 addition & 14 deletions modules/@angular/core/src/di/reflective_injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,6 @@ export abstract class ReflectiveInjector implements Injector {
*/
get parent(): Injector { return unimplemented(); }


/**
* @internal
*/
debugContext(): any { return null; }

/**
* Resolves an array of providers and creates a child injector from those providers.
*
Expand Down Expand Up @@ -603,19 +597,12 @@ export class ReflectiveInjector_ implements ReflectiveInjector {
/**
* Private
*/
constructor(
_proto: any /* ProtoInjector */, _parent: Injector = null,
private _debugContext: Function = null) {
constructor(_proto: any /* ProtoInjector */, _parent: Injector = null) {
this._proto = _proto;
this._parent = _parent;
this._strategy = _proto._strategy.createInjectorStrategy(this);
}

/**
* @internal
*/
debugContext(): any { return this._debugContext(); }

get(token: any, notFoundValue: any = THROW_IF_NOT_FOUND): any {
return this._getByKey(ReflectiveKey.get(token), null, null, notFoundValue);
}
Expand Down
19 changes: 0 additions & 19 deletions modules/@angular/core/test/di/reflective_injector_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,25 +336,6 @@ export function main() {
}
});

it('should provide context when throwing an exception ', () => {
var engineProvider =
ReflectiveInjector.resolve([{provide: Engine, useClass: BrokenEngine}])[0];
var protoParent = new ReflectiveProtoInjector([engineProvider]);

var carProvider = ReflectiveInjector.resolve([Car])[0];
var protoChild = new ReflectiveProtoInjector([carProvider]);

var parent = new ReflectiveInjector_(protoParent, null, () => 'parentContext');
var child = new ReflectiveInjector_(protoChild, parent, () => 'childContext');

try {
child.get(Car);
throw 'Must throw';
} catch (e) {
expect(e.context).toEqual('childContext');
}
});

it('should instantiate an object after a failed attempt', () => {
var isBroken = true;

Expand Down
2 changes: 1 addition & 1 deletion modules/@angular/router/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ export class Router {
resolvePromise(false);
}
},
(e: any) => {
(e: any) => {
if (e instanceof NavigationCancelingError) {
this.navigated = true;
this.routerEvents.next(
Expand Down