Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/swc_ecma_preset_env/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ where
let f = transform_data::Feature::$feature;
!exclude.contains(&f)
&& (c.force_all_transforms
|| (is_any_target
|| (!is_any_target
Copy link
Member

Choose a reason for hiding this comment

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

!is_any_target is wrong way to detect unknown browser version

Copy link
Member

Choose a reason for hiding this comment

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

!is_any_target is not a way to detect an unknown browser version

|| include.contains(&f)
|| f.should_enable(&targets, c.bugfixes, $default)))
}};
Expand Down Expand Up @@ -369,6 +369,9 @@ impl Polyfills {
+ VisitMutWith<corejs2::Entry>
+ VisitMutWith<corejs3::Entry>,
{
if self.targets.is_any_target() {
return Default::default();
}
let required = match self.mode {
None => Default::default(),
Some(Mode::Usage) => {
Expand Down
Loading