Skip to content

Commit

Permalink
Make options.json parsing strict
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Nov 8, 2024
1 parent 6a26f36 commit 77335cc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/swc_ecma_transforms_proposal/tests/decorators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn create_pass(comments: Rc<SingleThreadedComments>, input: &Path) -> Box<dyn Pa
for plugin in &options_json.plugins {
match plugin {
BabelPluginEntry::NameOnly(name) => match &**name {
"proposal-class-properties" => {
"proposal-class-properties" | "transform-class-properties" => {
add!(swc_ecma_transforms_compat::es2022::static_blocks(
static_block_mark
));
Expand All @@ -145,21 +145,23 @@ fn create_pass(comments: Rc<SingleThreadedComments>, input: &Path) -> Box<dyn Pa
continue;
}

"proposal-private-methods" => {
"proposal-private-methods" | "transform-private-methods" => {
add!(swc_ecma_transforms_compat::es2022::class_properties(
Default::default(),
unresolved_mark
));
continue;
}

"proposal-class-static-block" => {
"proposal-class-static-block" | "transform-class-static-block" => {
add!(swc_ecma_transforms_compat::es2022::static_blocks(
static_block_mark
));
continue;
}
_ => {}
_ => {
panic!("Unknown plugin: {}", name);
}
},
BabelPluginEntry::WithConfig(name, config) => match &**name {
"proposal-decorators" => match config {
Expand Down

0 comments on commit 77335cc

Please sign in to comment.