diff --git a/modules/angular2/src/core/debug/debug_renderer.ts b/modules/angular2/src/core/debug/debug_renderer.ts index 2935581514..c68c99352e 100644 --- a/modules/angular2/src/core/debug/debug_renderer.ts +++ b/modules/angular2/src/core/debug/debug_renderer.ts @@ -63,7 +63,8 @@ export class DebugDomRenderer implements Renderer { projectNodes(parentElement: any, nodes: any[]) { var debugParent = getDebugNode(parentElement); if (isPresent(debugParent) && debugParent instanceof DebugElement) { - nodes.forEach((node) => { debugParent.addChild(getDebugNode(node)); }); + let debugElement = debugParent; + nodes.forEach((node) => { debugElement.addChild(getDebugNode(node)); }); } this._delegate.projectNodes(parentElement, nodes); } diff --git a/modules/angular2/src/testing/testing.ts b/modules/angular2/src/testing/testing.ts index 9fd9637c71..a271de002b 100644 --- a/modules/angular2/src/testing/testing.ts +++ b/modules/angular2/src/testing/testing.ts @@ -131,16 +131,17 @@ function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | An var timeOut = testTimeOut; if (testFn instanceof FunctionWithParamTokens) { + let testFnT = testFn; jsmFn(name, (done) => { var returnedTestValue; try { - returnedTestValue = testInjector.execute(testFn); + returnedTestValue = testInjector.execute(testFnT); } catch (err) { done.fail(err); return; } - if (testFn.isAsync) { + if (testFnT.isAsync) { if (_isPromiseLike(returnedTestValue)) { (>returnedTestValue).then(() => { done(); }, (err) => { done.fail(err); }); } else { @@ -178,16 +179,17 @@ export function beforeEach(fn: FunctionWithParamTokens | AnyTestFn): void { if (fn instanceof FunctionWithParamTokens) { // The test case uses inject(). ie `beforeEach(inject([ClassA], (a) => { ... // }));` + let fnT = fn; jsmBeforeEach((done) => { var returnedTestValue; try { - returnedTestValue = testInjector.execute(fn); + returnedTestValue = testInjector.execute(fnT); } catch (err) { done.fail(err); return; } - if (fn.isAsync) { + if (fnT.isAsync) { if (_isPromiseLike(returnedTestValue)) { (>returnedTestValue).then(() => { done(); }, (err) => { done.fail(err); }); } else { diff --git a/modules/angular2/src/testing/testing_internal.ts b/modules/angular2/src/testing/testing_internal.ts index 582da830ca..7f7de03575 100644 --- a/modules/angular2/src/testing/testing_internal.ts +++ b/modules/angular2/src/testing/testing_internal.ts @@ -135,6 +135,7 @@ function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | An if (testFn instanceof FunctionWithParamTokens) { // The test case uses inject(). ie `it('test', inject([AsyncTestCompleter], (async) => { ... // }));` + let testFnT = testFn; if (testFn.hasToken(AsyncTestCompleter)) { jsmFn(name, (done) => { @@ -150,13 +151,13 @@ function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | An runner.run(); inIt = true; - testInjector.execute(testFn); + testInjector.execute(testFnT); inIt = false; }, timeOut); } else { jsmFn(name, () => { runner.run(); - testInjector.execute(testFn); + testInjector.execute(testFnT); }, timeOut); }