Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/visit): Visit TypeScript satisfies expressions (#6511)
- Loading branch information
Showing
6 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
crates/swc_ecma_transforms_base/tests/ts-resolver/stc/2/input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
type Movable = { | ||
move(distance: number): void; | ||
}; | ||
|
||
const car = { | ||
start() { }, | ||
move(d) { | ||
// d should be number | ||
}, | ||
stop() { } | ||
} satisfies Movable & Record<string, unknown>; |
8 changes: 8 additions & 0 deletions
8
crates/swc_ecma_transforms_base/tests/ts-resolver/stc/2/output.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
type Movable__1 = { | ||
move__0(distance: number): void; | ||
}; | ||
const car__1 = { | ||
start () {}, | ||
move (d__3) {}, | ||
stop () {} | ||
} satisfies Movable__1 & Record<string, unknown>; |
11 changes: 11 additions & 0 deletions
11
crates/swc_ecma_transforms_base/tests/ts-resolver/stc/3/input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
type Movable = { | ||
move(distance: number): void; | ||
}; | ||
|
||
const car = { | ||
start() { }, | ||
move(d) { | ||
// d should be number | ||
}, | ||
stop() { } | ||
} as Movable & Record<string, unknown>; |
8 changes: 8 additions & 0 deletions
8
crates/swc_ecma_transforms_base/tests/ts-resolver/stc/3/output.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
type Movable__1 = { | ||
move__0(distance: number): void; | ||
}; | ||
const car__1 = { | ||
start () {}, | ||
move (d__3) {}, | ||
stop () {} | ||
} as Movable__1 & Record<string, unknown>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0cee0e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/bugs-1
367788
ns/iter (± 29103
)343725
ns/iter (± 35985
)1.07
es/full/minify/libraries/antd
2047450639
ns/iter (± 32932806
)1920780678
ns/iter (± 19446273
)1.07
es/full/minify/libraries/d3
485082895
ns/iter (± 32764624
)453425285
ns/iter (± 13467547
)1.07
es/full/minify/libraries/echarts
1751762329
ns/iter (± 53742056
)1673549682
ns/iter (± 35740117
)1.05
es/full/minify/libraries/jquery
122134557
ns/iter (± 11173785
)106195557
ns/iter (± 3979181
)1.15
es/full/minify/libraries/lodash
127727864
ns/iter (± 2359898
)119116099
ns/iter (± 3980688
)1.07
es/full/minify/libraries/moment
66310305
ns/iter (± 3318850
)61056574
ns/iter (± 1940331
)1.09
es/full/minify/libraries/react
23068973
ns/iter (± 4802468
)20392111
ns/iter (± 768066
)1.13
es/full/minify/libraries/terser
343402070
ns/iter (± 19422170
)325606279
ns/iter (± 5716295
)1.05
es/full/minify/libraries/three
610517853
ns/iter (± 18435679
)565290116
ns/iter (± 14133209
)1.08
es/full/minify/libraries/typescript
3668439590
ns/iter (± 92737404
)3386248125
ns/iter (± 37649841
)1.08
es/full/minify/libraries/victory
895860038
ns/iter (± 71837733
)840360756
ns/iter (± 12367009
)1.07
es/full/minify/libraries/vue
186598305
ns/iter (± 10187949
)161071945
ns/iter (± 13825072
)1.16
es/full/codegen/es3
34412
ns/iter (± 2810
)33640
ns/iter (± 1652
)1.02
es/full/codegen/es5
34244
ns/iter (± 1911
)33423
ns/iter (± 2292
)1.02
es/full/codegen/es2015
34835
ns/iter (± 1631
)33578
ns/iter (± 1310
)1.04
es/full/codegen/es2016
34518
ns/iter (± 2166
)33452
ns/iter (± 2461
)1.03
es/full/codegen/es2017
33616
ns/iter (± 1068
)33385
ns/iter (± 1658
)1.01
es/full/codegen/es2018
33515
ns/iter (± 967
)33207
ns/iter (± 1268
)1.01
es/full/codegen/es2019
33665
ns/iter (± 2069
)33349
ns/iter (± 843
)1.01
es/full/codegen/es2020
34231
ns/iter (± 1384
)32879
ns/iter (± 7416
)1.04
es/full/all/es3
197666358
ns/iter (± 11084664
)191712687
ns/iter (± 6938640
)1.03
es/full/all/es5
186210674
ns/iter (± 16652218
)180181303
ns/iter (± 6780544
)1.03
es/full/all/es2015
149786790
ns/iter (± 9167233
)145227350
ns/iter (± 4693508
)1.03
es/full/all/es2016
152026746
ns/iter (± 10212536
)142588261
ns/iter (± 4052083
)1.07
es/full/all/es2017
149578096
ns/iter (± 11225753
)146923796
ns/iter (± 6740560
)1.02
es/full/all/es2018
152730868
ns/iter (± 91797279
)140361734
ns/iter (± 3504576
)1.09
es/full/all/es2019
143747527
ns/iter (± 9268309
)139163534
ns/iter (± 3577505
)1.03
es/full/all/es2020
134960934
ns/iter (± 6861339
)136694510
ns/iter (± 4134678
)0.99
es/full/parser
731489
ns/iter (± 61108
)708445
ns/iter (± 26460
)1.03
es/full/base/fixer
26218
ns/iter (± 1630
)26395
ns/iter (± 1192
)0.99
es/full/base/resolver_and_hygiene
93461
ns/iter (± 10073
)92861
ns/iter (± 3734
)1.01
serialization of ast node
206
ns/iter (± 14
)204
ns/iter (± 8
)1.01
serialization of serde
217
ns/iter (± 18
)217
ns/iter (± 6
)1
This comment was automatically generated by workflow using github-action-benchmark.