swc/crates/swc_ecma_parser/tests/tsc/logicalAssignment6.ts

14 lines
438 B
TypeScript

// @strict: true
// @target: esnext, es2020, es2015
function foo1(results: number[] | undefined, results1: number[] | undefined) {
(results ||= (results1 ||= [])).push(100);
}
function foo2(results: number[] | undefined, results1: number[] | undefined) {
(results ??= (results1 ??= [])).push(100);
}
function foo3(results: number[] | undefined, results1: number[] | undefined) {
(results &&= (results1 &&= [])).push(100);
}