File tree Expand file tree Collapse file tree 2 files changed +23
-9
lines changed
crates/swc_ecma_transformer/src/es2016 Expand file tree Collapse file tree 2 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 1+ use swc_ecma_hooks:: VisitMutHook ;
2+
3+ use crate :: TraverseCtx ;
4+
5+ pub fn hook ( ) -> impl VisitMutHook < TraverseCtx > {
6+ ExponentiationOperatorPass :: default ( )
7+ }
8+
9+ #[ derive( Default ) ]
10+ struct ExponentiationOperatorPass { }
11+
12+ impl VisitMutHook < TraverseCtx > for ExponentiationOperatorPass { }
Original file line number Diff line number Diff line change 1+ mod exponentation_operator;
2+
13use swc_ecma_hooks:: VisitMutHook ;
24
3- use crate :: TraverseCtx ;
5+ use crate :: { hook_utils :: OptionalHook , TraverseCtx } ;
46
57#[ derive( Debug , Default ) ]
68#[ non_exhaustive]
7- pub struct Es2016Options { }
8-
9- pub fn hook ( options : Es2016Options ) -> impl VisitMutHook < TraverseCtx > {
10- Es2016Pass { options }
9+ pub struct Es2016Options {
10+ pub exponentation_operator : bool ,
1111}
1212
13- struct Es2016Pass {
14- options : Es2016Options ,
13+ pub fn hook ( options : Es2016Options ) -> impl VisitMutHook < TraverseCtx > {
14+ OptionalHook ( if options. exponentation_operator {
15+ Some ( self :: exponentation_operator:: hook ( ) )
16+ } else {
17+ None
18+ } )
1519}
16-
17- impl VisitMutHook < TraverseCtx > for Es2016Pass { }
You can’t perform that action at this time.
0 commit comments