You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,17): error TS2493: Tuple type '[any]' with length '1' cannot be assigned to tuple with length '3'.
2
+
tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,29): error TS2493: Tuple type '[any]' with length '1' cannot be assigned to tuple with length '3'.
[this.test,this.test1,this.test2]=array;// even though there is a compiler error, we should still emit lexical capture for "this"
5
+
});
6
+
7
+
//// [emitCapturingThisInTupleDestructuring1.js]
8
+
var_this=this;
9
+
wrapper(function(array){
10
+
_this.test=array[0],_this.test1=array[1],_this.test2=array[2];// even though there is a compiler error, we should still emit lexical capture for "this"
tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts(8,39): error TS2493: Tuple type '[number, number]' with length '2' cannot be assigned to tuple with length '3'.
()=>[this.test,this.test1,this.test2]=array1;// even though there is a compiler error, we should still emit lexical capture for "this"
10
+
}
11
+
}
12
+
13
+
//// [emitCapturingThisInTupleDestructuring2.js]
14
+
vararray1=[1,2];
15
+
varB=(function(){
16
+
functionB(){
17
+
}
18
+
B.prototype.method=function(){
19
+
var_this=this;
20
+
(function(){return(_this.test=array1[0],_this.test1=array1[1],_this.test2=array1[2],array1);});// even though there is a compiler error, we should still emit lexical capture for "this"
0 commit comments