-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/resolver): Make catch parameter not disturb resolving (#4976)
- Loading branch information
Showing
10 changed files
with
171 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,77 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "ecmascript", | ||
"jsx": false | ||
}, | ||
"target": "es2015", | ||
"loose": false, | ||
"minify": { | ||
"compress": { | ||
"arguments": false, | ||
"arrows": true, | ||
"booleans": true, | ||
"booleans_as_integers": false, | ||
"collapse_vars": true, | ||
"comparisons": true, | ||
"computed_props": false, | ||
"conditionals": false, | ||
"dead_code": false, | ||
"directives": false, | ||
"drop_console": false, | ||
"drop_debugger": true, | ||
"evaluate": true, | ||
"expression": false, | ||
"hoist_funs": false, | ||
"hoist_props": true, | ||
"hoist_vars": false, | ||
"if_return": true, | ||
"join_vars": true, | ||
"keep_classnames": false, | ||
"keep_fargs": true, | ||
"keep_fnames": false, | ||
"keep_infinity": false, | ||
"loops": true, | ||
"negate_iife": true, | ||
"properties": true, | ||
"reduce_funcs": false, | ||
"reduce_vars": false, | ||
"side_effects": true, | ||
"switches": false, | ||
"typeofs": true, | ||
"unsafe": false, | ||
"unsafe_arrows": false, | ||
"unsafe_comps": false, | ||
"unsafe_Function": false, | ||
"unsafe_math": false, | ||
"unsafe_symbols": false, | ||
"unsafe_methods": false, | ||
"unsafe_proto": false, | ||
"unsafe_regexp": false, | ||
"unsafe_undefined": false, | ||
"unused": true | ||
}, | ||
"mangle": { | ||
"toplevel": false, | ||
"keep_classnames": false, | ||
"keep_fnames": false, | ||
"keep_private_props": false, | ||
"ie8": false, | ||
"safari10": false | ||
} | ||
}, | ||
"transform": { | ||
"react": { | ||
"refresh": true, | ||
"development": true | ||
}, | ||
"optimizer": { | ||
"simplify": true | ||
} | ||
} | ||
}, | ||
"module": { | ||
"type": "commonjs" | ||
}, | ||
"minify": false | ||
} |
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,19 @@ | ||
/* eslint-disable */ | ||
export default function (module, exports) { | ||
"use strict"; | ||
!function (t, e) { | ||
e(exports) | ||
}(void 0, function (t) { | ||
"use strict"; | ||
function vr(e, r, o) { | ||
try { | ||
} catch (t) { | ||
} | ||
function t() { | ||
return '123'; | ||
} | ||
return t; | ||
} | ||
t.vr = vr; | ||
}); | ||
}; |
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,17 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: !0 | ||
}), exports.default = function(a, b) { | ||
"use strict"; | ||
!function(c, a) { | ||
a(b); | ||
}(void 0, function(a) { | ||
"use strict"; | ||
a.vr = function(b, c, d) { | ||
function a() { | ||
return '123'; | ||
} | ||
return a; | ||
}; | ||
}); | ||
}; |
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
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
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
18 changes: 18 additions & 0 deletions
18
crates/swc_ecma_transforms_base/tests/resolver/issue-4953/input.js
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,18 @@ | ||
export default function (module, exports) { | ||
"use strict"; | ||
!function (t, e) { | ||
e(exports) | ||
}(void 0, function (t) { | ||
"use strict"; | ||
function vr(e, r, o) { | ||
try { | ||
} catch (t) { | ||
} | ||
function t() { | ||
return '123'; | ||
} | ||
return t; | ||
} | ||
t.vr = vr; | ||
}); | ||
}; |
17 changes: 17 additions & 0 deletions
17
crates/swc_ecma_transforms_base/tests/resolver/issue-4953/output.js
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,17 @@ | ||
export default function(module__1, exports__1) { | ||
"use strict"; | ||
!function(t__2, e__2) { | ||
e__2(exports__1); | ||
}(void 0, function(t__3) { | ||
"use strict"; | ||
function vr__3(e__4, r__4, o__4) { | ||
try {} catch (t__5) {} | ||
function t__4() { | ||
return '123'; | ||
} | ||
return t__4; | ||
} | ||
t__3.vr = vr__3; | ||
}); | ||
}; | ||
; |
b3f6f20
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/minify/libraries/antd
1560547909
ns/iter (± 37211665
)1651380021
ns/iter (± 19871163
)0.94
es/full/minify/libraries/d3
398758739
ns/iter (± 5549816
)428159693
ns/iter (± 7213237
)0.93
es/full/minify/libraries/echarts
1568085545
ns/iter (± 16208371
)1673581047
ns/iter (± 24837962
)0.94
es/full/minify/libraries/jquery
86698027
ns/iter (± 1084928
)106064958
ns/iter (± 1562294
)0.82
es/full/minify/libraries/lodash
113880836
ns/iter (± 936068
)140387189
ns/iter (± 2319861
)0.81
es/full/minify/libraries/moment
50459586
ns/iter (± 295623
)60832496
ns/iter (± 2102924
)0.83
es/full/minify/libraries/react
16902972
ns/iter (± 169868
)19667956
ns/iter (± 1174637
)0.86
es/full/minify/libraries/terser
592028700
ns/iter (± 10718320
)624343753
ns/iter (± 6510234
)0.95
es/full/minify/libraries/three
528787076
ns/iter (± 11110827
)557937642
ns/iter (± 13085822
)0.95
es/full/minify/libraries/typescript
3350887495
ns/iter (± 37754400
)3384490193
ns/iter (± 53654242
)0.99
es/full/minify/libraries/victory
701306586
ns/iter (± 7928017
)713254291
ns/iter (± 34781682
)0.98
es/full/minify/libraries/vue
136276052
ns/iter (± 5605817
)160361157
ns/iter (± 3033272
)0.85
es/full/codegen/es3
31539
ns/iter (± 452
)32724
ns/iter (± 1101
)0.96
es/full/codegen/es5
31624
ns/iter (± 683
)32935
ns/iter (± 1378
)0.96
es/full/codegen/es2015
31545
ns/iter (± 690
)32528
ns/iter (± 1080
)0.97
es/full/codegen/es2016
31599
ns/iter (± 875
)32467
ns/iter (± 699
)0.97
es/full/codegen/es2017
31573
ns/iter (± 902
)32436
ns/iter (± 570
)0.97
es/full/codegen/es2018
31622
ns/iter (± 1281
)32401
ns/iter (± 464
)0.98
es/full/codegen/es2019
31616
ns/iter (± 421
)32556
ns/iter (± 608
)0.97
es/full/codegen/es2020
31592
ns/iter (± 506
)32523
ns/iter (± 1157
)0.97
es/full/all/es3
187016689
ns/iter (± 3361911
)191068351
ns/iter (± 7590272
)0.98
es/full/all/es5
174167641
ns/iter (± 2654308
)179333047
ns/iter (± 7174950
)0.97
es/full/all/es2015
140262782
ns/iter (± 1510653
)145560329
ns/iter (± 6531334
)0.96
es/full/all/es2016
139461105
ns/iter (± 2404291
)147315740
ns/iter (± 5965556
)0.95
es/full/all/es2017
139147154
ns/iter (± 1877653
)146192675
ns/iter (± 4894367
)0.95
es/full/all/es2018
137312283
ns/iter (± 2086517
)142372471
ns/iter (± 3004961
)0.96
es/full/all/es2019
136747635
ns/iter (± 1774869
)140608969
ns/iter (± 3653912
)0.97
es/full/all/es2020
131860852
ns/iter (± 2087377
)135643130
ns/iter (± 4423887
)0.97
es/full/parser
672884
ns/iter (± 20431
)697290
ns/iter (± 22922
)0.96
es/full/base/fixer
28560
ns/iter (± 733
)29148
ns/iter (± 1390
)0.98
es/full/base/resolver_and_hygiene
127971
ns/iter (± 4524
)133170
ns/iter (± 6769
)0.96
serialization of ast node
211
ns/iter (± 7
)206
ns/iter (± 1
)1.02
serialization of serde
215
ns/iter (± 8
)217
ns/iter (± 2
)0.99
This comment was automatically generated by workflow using github-action-benchmark.