mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
23 lines
681 B
TypeScript
23 lines
681 B
TypeScript
//// [tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts] ////
|
|
|
|
//// [emitCapturingThisInTupleDestructuring2.ts]
|
|
var array1: [number, number] = [1, 2];
|
|
|
|
class B {
|
|
test: number;
|
|
test1: any;
|
|
test2: any;
|
|
method() {
|
|
() => [this.test, this.test1, this.test2] = array1; // even though there is a compiler error, we should still emit lexical capture for "this"
|
|
}
|
|
}
|
|
|
|
//// [emitCapturingThisInTupleDestructuring2.js]
|
|
"use strict";
|
|
var array1 = [1, 2];
|
|
class B {
|
|
method() {
|
|
() => [this.test, this.test1, this.test2] = array1; // even though there is a compiler error, we should still emit lexical capture for "this"
|
|
}
|
|
}
|