Skip to content

Commit

Permalink
fix(es/compat): Handle export default decorator only if not empty (#8099
Browse files Browse the repository at this point in the history
)

**Related issue:**

 - Closes: #8098
  • Loading branch information
magic-akari authored Oct 11, 2023
1 parent 3dc761a commit bf523f5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ impl VisitMut for Decorator202203 {
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultDecl(ExportDefaultDecl {
span: _,
decl: DefaultDecl::Class(c),
})) => {
})) if !c.class.decorators.is_empty() => {
self.handle_class_expr(&mut c.class, c.ident.as_ref());
s.visit_mut_children_with(self);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default class T {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export default class T {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": [["proposal-decorators", { "version": "2022-03" }]]
}

1 comment on commit bf523f5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: bf523f5 Previous: f5d7acf Ratio
es/full/bugs-1 286436 ns/iter (± 4585) 286359 ns/iter (± 4127) 1.00
es/full/minify/libraries/antd 1400347639 ns/iter (± 16609304) 1393736165 ns/iter (± 25069785) 1.00
es/full/minify/libraries/d3 294023732 ns/iter (± 1850431) 296153563 ns/iter (± 5473255) 0.99
es/full/minify/libraries/echarts 1127336882 ns/iter (± 14178180) 1120107412 ns/iter (± 9931834) 1.01
es/full/minify/libraries/jquery 88856810 ns/iter (± 543497) 88812640 ns/iter (± 635028) 1.00
es/full/minify/libraries/lodash 103606704 ns/iter (± 578031) 104309085 ns/iter (± 643210) 0.99
es/full/minify/libraries/moment 52381550 ns/iter (± 187864) 52108482 ns/iter (± 110984) 1.01
es/full/minify/libraries/react 18840965 ns/iter (± 246708) 18826987 ns/iter (± 65722) 1.00
es/full/minify/libraries/terser 229990486 ns/iter (± 976227) 230826920 ns/iter (± 1052248) 1.00
es/full/minify/libraries/three 410313108 ns/iter (± 1907901) 409467595 ns/iter (± 2930821) 1.00
es/full/minify/libraries/typescript 2797504164 ns/iter (± 12436927) 2774462791 ns/iter (± 20644780) 1.01
es/full/minify/libraries/victory 597667068 ns/iter (± 4934899) 605731953 ns/iter (± 11584196) 0.99
es/full/minify/libraries/vue 126614462 ns/iter (± 642285) 125365585 ns/iter (± 692448) 1.01
es/full/codegen/es3 35186 ns/iter (± 76) 34882 ns/iter (± 227) 1.01
es/full/codegen/es5 34932 ns/iter (± 132) 34706 ns/iter (± 151) 1.01
es/full/codegen/es2015 35088 ns/iter (± 72) 34814 ns/iter (± 42) 1.01
es/full/codegen/es2016 35128 ns/iter (± 209) 34749 ns/iter (± 160) 1.01
es/full/codegen/es2017 35111 ns/iter (± 90) 34737 ns/iter (± 127) 1.01
es/full/codegen/es2018 35140 ns/iter (± 71) 34837 ns/iter (± 90) 1.01
es/full/codegen/es2019 35106 ns/iter (± 68) 34765 ns/iter (± 85) 1.01
es/full/codegen/es2020 35099 ns/iter (± 99) 34803 ns/iter (± 186) 1.01
es/full/all/es3 179883707 ns/iter (± 1299414) 178319549 ns/iter (± 1624839) 1.01
es/full/all/es5 173165244 ns/iter (± 2580895) 170734413 ns/iter (± 2190765) 1.01
es/full/all/es2015 130826150 ns/iter (± 988763) 130352425 ns/iter (± 863140) 1.00
es/full/all/es2016 129785657 ns/iter (± 1246568) 128745964 ns/iter (± 785303) 1.01
es/full/all/es2017 128354081 ns/iter (± 1637484) 128471979 ns/iter (± 995171) 1.00
es/full/all/es2018 126342347 ns/iter (± 1776956) 126407468 ns/iter (± 1216997) 1.00
es/full/all/es2019 126341252 ns/iter (± 935500) 125747649 ns/iter (± 528811) 1.00
es/full/all/es2020 121716394 ns/iter (± 936688) 121074504 ns/iter (± 839994) 1.01
es/full/parser 579471 ns/iter (± 3740) 572124 ns/iter (± 4592) 1.01
es/full/base/fixer 18644 ns/iter (± 118) 18187 ns/iter (± 60) 1.03
es/full/base/resolver_and_hygiene 84622 ns/iter (± 163) 85844 ns/iter (± 442) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.