Skip to content

Commit

Permalink
feat(ecmascript): add feature flag for constant evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Oct 15, 2024
1 parent 8e4f636 commit 15c04e5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions crates/oxc_ecmascript/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ oxc_syntax = { workspace = true, features = ["to_js_string"] }

num-bigint = { workspace = true }
num-traits = { workspace = true }

[features]
default = []
side_effects = []
constant_evaluation = ["side_effects"]
4 changes: 2 additions & 2 deletions crates/oxc_ecmascript/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ mod to_int_32;
mod to_number;
mod to_string;

// Constant Evaluation
#[cfg(feature = "constant_evaluation")]
pub mod constant_evaluation;

// Side Effects
#[cfg(feature = "side_effects")]
pub mod side_effects;

pub use self::{
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_minifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ doctest = false
oxc_allocator = { workspace = true }
oxc_ast = { workspace = true }
oxc_codegen = { workspace = true }
oxc_ecmascript = { workspace = true }
oxc_ecmascript = { workspace = true, features = ["constant_evaluation"] }
oxc_mangler = { workspace = true }
oxc_parser = { workspace = true }
oxc_semantic = { workspace = true }
Expand Down

0 comments on commit 15c04e5

Please sign in to comment.