Skip to content

Commit de9547c

Browse files
author
Yui T
committed
Update type checking for lexical binding due to merge with master
1 parent 581beb5 commit de9547c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/compiler/checker.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -4832,9 +4832,12 @@ module ts {
48324832
container = getThisContainer(container, /* includeArrowFunctions */ false);
48334833

48344834
// When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code
4835-
if (compilerOptions.target < ScriptTarget.ES6) {
4836-
needToCaptureLexicalThis = true;
4835+
if (compilerOptions.target >= ScriptTarget.ES6) {
4836+
needToCaptureLexicalThis = false;
48374837
}
4838+
else {
4839+
needToCaptureLexicalThis = true;
4840+
}
48384841
}
48394842

48404843
switch (container.kind) {

0 commit comments

Comments
 (0)