X Tutup
Skip to content

Commit f942670

Browse files
committed
chore(build): Fix errors reported using 1.9.
Closes angular#7954
1 parent e1e44a9 commit f942670

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

modules/angular2/src/core/debug/debug_renderer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export class DebugDomRenderer implements Renderer {
6363
projectNodes(parentElement: any, nodes: any[]) {
6464
var debugParent = getDebugNode(parentElement);
6565
if (isPresent(debugParent) && debugParent instanceof DebugElement) {
66-
nodes.forEach((node) => { debugParent.addChild(getDebugNode(node)); });
66+
let debugElement = debugParent;
67+
nodes.forEach((node) => { debugElement.addChild(getDebugNode(node)); });
6768
}
6869
this._delegate.projectNodes(parentElement, nodes);
6970
}

modules/angular2/src/testing/testing.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,17 @@ function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | An
131131
var timeOut = testTimeOut;
132132

133133
if (testFn instanceof FunctionWithParamTokens) {
134+
let testFnT = testFn;
134135
jsmFn(name, (done) => {
135136
var returnedTestValue;
136137
try {
137-
returnedTestValue = testInjector.execute(testFn);
138+
returnedTestValue = testInjector.execute(testFnT);
138139
} catch (err) {
139140
done.fail(err);
140141
return;
141142
}
142143

143-
if (testFn.isAsync) {
144+
if (testFnT.isAsync) {
144145
if (_isPromiseLike(returnedTestValue)) {
145146
(<Promise<any>>returnedTestValue).then(() => { done(); }, (err) => { done.fail(err); });
146147
} else {
@@ -178,16 +179,17 @@ export function beforeEach(fn: FunctionWithParamTokens | AnyTestFn): void {
178179
if (fn instanceof FunctionWithParamTokens) {
179180
// The test case uses inject(). ie `beforeEach(inject([ClassA], (a) => { ...
180181
// }));`
182+
let fnT = fn;
181183
jsmBeforeEach((done) => {
182184

183185
var returnedTestValue;
184186
try {
185-
returnedTestValue = testInjector.execute(fn);
187+
returnedTestValue = testInjector.execute(fnT);
186188
} catch (err) {
187189
done.fail(err);
188190
return;
189191
}
190-
if (fn.isAsync) {
192+
if (fnT.isAsync) {
191193
if (_isPromiseLike(returnedTestValue)) {
192194
(<Promise<any>>returnedTestValue).then(() => { done(); }, (err) => { done.fail(err); });
193195
} else {

modules/angular2/src/testing/testing_internal.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | An
135135
if (testFn instanceof FunctionWithParamTokens) {
136136
// The test case uses inject(). ie `it('test', inject([AsyncTestCompleter], (async) => { ...
137137
// }));`
138+
let testFnT = testFn;
138139

139140
if (testFn.hasToken(AsyncTestCompleter)) {
140141
jsmFn(name, (done) => {
@@ -150,13 +151,13 @@ function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | An
150151
runner.run();
151152

152153
inIt = true;
153-
testInjector.execute(testFn);
154+
testInjector.execute(testFnT);
154155
inIt = false;
155156
}, timeOut);
156157
} else {
157158
jsmFn(name, () => {
158159
runner.run();
159-
testInjector.execute(testFn);
160+
testInjector.execute(testFnT);
160161
}, timeOut);
161162
}
162163

0 commit comments

Comments
 (0)
X Tutup