File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,25 @@ let x = 0;
8
8
function f1 ( options ?: { color ?: string , width ?: number } ) {
9
9
let { color, width } = options || { } ;
10
10
( { color, width } = options || { } ) ;
11
+ let x1 = ( options || { } ) . color ;
12
+ let x2 = ( options || { } ) [ "color" ] ;
11
13
}
12
14
13
15
function f2 ( options ?: [ string ?, number ?] ) {
14
16
let [ str , num ] = options || [ ] ;
15
17
[ str , num ] = options || [ ] ;
18
+ let x1 = ( options || { } ) [ 0 ] ;
19
+ }
20
+
21
+ function f3 ( options ?: { color : string , width : number } ) {
22
+ let { color, width } = options || { } ;
23
+ ( { color, width } = options || { } ) ;
24
+ let x1 = ( options || { } ) . color ;
25
+ let x2 = ( options || { } ) [ "color" ] ;
26
+ }
27
+
28
+ function f4 ( options ?: [ string , number ] ) {
29
+ let [ str , num ] = options || [ ] ;
30
+ [ str , num ] = options || [ ] ;
31
+ let x1 = ( options || { } ) [ 0 ] ;
16
32
}
You can’t perform that action at this time.
0 commit comments