mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
108 lines
5.1 KiB
Plaintext
108 lines
5.1 KiB
Plaintext
//// [tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts] ////
|
|
|
|
=== missingAndExcessProperties.ts ===
|
|
// Missing properties
|
|
function f1() {
|
|
>f1 : Symbol(f1, Decl(missingAndExcessProperties.ts, 0, 0))
|
|
|
|
var { x, y } = {};
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 2, 9), Decl(missingAndExcessProperties.ts, 3, 9), Decl(missingAndExcessProperties.ts, 4, 9), Decl(missingAndExcessProperties.ts, 5, 9))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 2, 12), Decl(missingAndExcessProperties.ts, 3, 16), Decl(missingAndExcessProperties.ts, 4, 12), Decl(missingAndExcessProperties.ts, 5, 16))
|
|
|
|
var { x = 1, y } = {};
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 2, 9), Decl(missingAndExcessProperties.ts, 3, 9), Decl(missingAndExcessProperties.ts, 4, 9), Decl(missingAndExcessProperties.ts, 5, 9))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 2, 12), Decl(missingAndExcessProperties.ts, 3, 16), Decl(missingAndExcessProperties.ts, 4, 12), Decl(missingAndExcessProperties.ts, 5, 16))
|
|
|
|
var { x, y = 1 } = {};
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 2, 9), Decl(missingAndExcessProperties.ts, 3, 9), Decl(missingAndExcessProperties.ts, 4, 9), Decl(missingAndExcessProperties.ts, 5, 9))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 2, 12), Decl(missingAndExcessProperties.ts, 3, 16), Decl(missingAndExcessProperties.ts, 4, 12), Decl(missingAndExcessProperties.ts, 5, 16))
|
|
|
|
var { x = 1, y = 1 } = {};
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 2, 9), Decl(missingAndExcessProperties.ts, 3, 9), Decl(missingAndExcessProperties.ts, 4, 9), Decl(missingAndExcessProperties.ts, 5, 9))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 2, 12), Decl(missingAndExcessProperties.ts, 3, 16), Decl(missingAndExcessProperties.ts, 4, 12), Decl(missingAndExcessProperties.ts, 5, 16))
|
|
}
|
|
|
|
// Missing properties
|
|
function f2() {
|
|
>f2 : Symbol(f2, Decl(missingAndExcessProperties.ts, 6, 1))
|
|
|
|
var x: number, y: number;
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 10, 7))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 10, 18))
|
|
|
|
({ x, y } = {});
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 11, 6))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 11, 9))
|
|
|
|
({ x: x = 1, y } = {});
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 12, 6))
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 10, 7))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 12, 16))
|
|
|
|
({ x, y: y = 1 } = {});
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 13, 6))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 13, 9))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 10, 18))
|
|
|
|
({ x: x = 1, y: y = 1 } = {});
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 14, 6))
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 10, 7))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 14, 16))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 10, 18))
|
|
}
|
|
|
|
// Excess properties
|
|
function f3() {
|
|
>f3 : Symbol(f3, Decl(missingAndExcessProperties.ts, 15, 1))
|
|
|
|
var { } = { x: 0, y: 0 };
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 19, 15))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 19, 21))
|
|
|
|
var { x } = { x: 0, y: 0 };
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 20, 9), Decl(missingAndExcessProperties.ts, 22, 9))
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 20, 17))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 20, 23))
|
|
|
|
var { y } = { x: 0, y: 0 };
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 21, 9), Decl(missingAndExcessProperties.ts, 22, 12))
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 21, 17))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 21, 23))
|
|
|
|
var { x, y } = { x: 0, y: 0 };
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 20, 9), Decl(missingAndExcessProperties.ts, 22, 9))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 21, 9), Decl(missingAndExcessProperties.ts, 22, 12))
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 22, 20))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 22, 26))
|
|
}
|
|
|
|
// Excess properties
|
|
function f4() {
|
|
>f4 : Symbol(f4, Decl(missingAndExcessProperties.ts, 23, 1))
|
|
|
|
var x: number, y: number;
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 27, 7))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 27, 18))
|
|
|
|
({ } = { x: 0, y: 0 });
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 28, 12))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 28, 18))
|
|
|
|
({ x } = { x: 0, y: 0 });
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 29, 6))
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 29, 14))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 29, 20))
|
|
|
|
({ y } = { x: 0, y: 0 });
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 30, 6))
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 30, 14))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 30, 20))
|
|
|
|
({ x, y } = { x: 0, y: 0 });
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 31, 6))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 31, 9))
|
|
>x : Symbol(x, Decl(missingAndExcessProperties.ts, 31, 17))
|
|
>y : Symbol(y, Decl(missingAndExcessProperties.ts, 31, 23))
|
|
}
|
|
|