@@ -27,20 +27,84 @@ function f1(options?: { color?: string, width?: number }) {
27
27
>color : Symbol(color, Decl(destructuringAssignmentWithDefault.ts, 8, 6))
28
28
>width : Symbol(width, Decl(destructuringAssignmentWithDefault.ts, 8, 13))
29
29
>options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 6, 12))
30
+
31
+ let x1 = (options || {}).color;
32
+ >x1 : Symbol(x1, Decl(destructuringAssignmentWithDefault.ts, 9, 7))
33
+ >(options || {}).color : Symbol(color, Decl(destructuringAssignmentWithDefault.ts, 6, 23))
34
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 6, 12))
35
+ >color : Symbol(color, Decl(destructuringAssignmentWithDefault.ts, 6, 23))
36
+
37
+ let x2 = (options || {})["color"];
38
+ >x2 : Symbol(x2, Decl(destructuringAssignmentWithDefault.ts, 10, 7))
39
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 6, 12))
40
+ >"color" : Symbol(color, Decl(destructuringAssignmentWithDefault.ts, 6, 23))
30
41
}
31
42
32
43
function f2(options?: [string?, number?]) {
33
- >f2 : Symbol(f2, Decl(destructuringAssignmentWithDefault.ts, 9 , 1))
34
- >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 11 , 12))
44
+ >f2 : Symbol(f2, Decl(destructuringAssignmentWithDefault.ts, 11 , 1))
45
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 13 , 12))
35
46
36
47
let [str, num] = options || [];
37
- >str : Symbol(str, Decl(destructuringAssignmentWithDefault.ts, 12 , 9))
38
- >num : Symbol(num, Decl(destructuringAssignmentWithDefault.ts, 12 , 13))
39
- >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 11 , 12))
48
+ >str : Symbol(str, Decl(destructuringAssignmentWithDefault.ts, 14 , 9))
49
+ >num : Symbol(num, Decl(destructuringAssignmentWithDefault.ts, 14 , 13))
50
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 13 , 12))
40
51
41
52
[str, num] = options || [];
42
- >str : Symbol(str, Decl(destructuringAssignmentWithDefault.ts, 12, 9))
43
- >num : Symbol(num, Decl(destructuringAssignmentWithDefault.ts, 12, 13))
44
- >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 11, 12))
53
+ >str : Symbol(str, Decl(destructuringAssignmentWithDefault.ts, 14, 9))
54
+ >num : Symbol(num, Decl(destructuringAssignmentWithDefault.ts, 14, 13))
55
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 13, 12))
56
+
57
+ let x1 = (options || {})[0];
58
+ >x1 : Symbol(x1, Decl(destructuringAssignmentWithDefault.ts, 16, 7))
59
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 13, 12))
60
+ >0 : Symbol(0)
61
+ }
62
+
63
+ function f3(options?: { color: string, width: number }) {
64
+ >f3 : Symbol(f3, Decl(destructuringAssignmentWithDefault.ts, 17, 1))
65
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 19, 12))
66
+ >color : Symbol(color, Decl(destructuringAssignmentWithDefault.ts, 19, 23))
67
+ >width : Symbol(width, Decl(destructuringAssignmentWithDefault.ts, 19, 38))
68
+
69
+ let { color, width } = options || {};
70
+ >color : Symbol(color, Decl(destructuringAssignmentWithDefault.ts, 20, 9))
71
+ >width : Symbol(width, Decl(destructuringAssignmentWithDefault.ts, 20, 16))
72
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 19, 12))
73
+
74
+ ({ color, width } = options || {});
75
+ >color : Symbol(color, Decl(destructuringAssignmentWithDefault.ts, 21, 6))
76
+ >width : Symbol(width, Decl(destructuringAssignmentWithDefault.ts, 21, 13))
77
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 19, 12))
78
+
79
+ let x1 = (options || {}).color;
80
+ >x1 : Symbol(x1, Decl(destructuringAssignmentWithDefault.ts, 22, 7))
81
+ >(options || {}).color : Symbol(color, Decl(destructuringAssignmentWithDefault.ts, 19, 23))
82
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 19, 12))
83
+ >color : Symbol(color, Decl(destructuringAssignmentWithDefault.ts, 19, 23))
84
+
85
+ let x2 = (options || {})["color"];
86
+ >x2 : Symbol(x2, Decl(destructuringAssignmentWithDefault.ts, 23, 7))
87
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 19, 12))
88
+ >"color" : Symbol(color, Decl(destructuringAssignmentWithDefault.ts, 19, 23))
89
+ }
90
+
91
+ function f4(options?: [string, number]) {
92
+ >f4 : Symbol(f4, Decl(destructuringAssignmentWithDefault.ts, 24, 1))
93
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 26, 12))
94
+
95
+ let [str, num] = options || [];
96
+ >str : Symbol(str, Decl(destructuringAssignmentWithDefault.ts, 27, 9))
97
+ >num : Symbol(num, Decl(destructuringAssignmentWithDefault.ts, 27, 13))
98
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 26, 12))
99
+
100
+ [str, num] = options || [];
101
+ >str : Symbol(str, Decl(destructuringAssignmentWithDefault.ts, 27, 9))
102
+ >num : Symbol(num, Decl(destructuringAssignmentWithDefault.ts, 27, 13))
103
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 26, 12))
104
+
105
+ let x1 = (options || {})[0];
106
+ >x1 : Symbol(x1, Decl(destructuringAssignmentWithDefault.ts, 29, 7))
107
+ >options : Symbol(options, Decl(destructuringAssignmentWithDefault.ts, 26, 12))
108
+ >0 : Symbol(0)
45
109
}
46
110
0 commit comments