chore(build): Fix errors reported using 1.9.

Closes #7954
This commit is contained in:
Chuck Jazdzewski 2016-04-07 13:29:52 -07:00
parent e1e44a910e
commit f9426709ef
3 changed files with 11 additions and 7 deletions

View File

@ -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);
}

View File

@ -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)) {
(<Promise<any>>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)) {
(<Promise<any>>returnedTestValue).then(() => { done(); }, (err) => { done.fail(err); });
} else {

View File

@ -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);
}