1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
=== tests/cases/conformance/es6/destructuring/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))
}
|