feat(ecmascript): add feature flag for constant evaluation

This commit is contained in:
Boshen 2024-10-15 23:48:15 +08:00
parent 8e4f6368f8
commit 15c04e5cbb
No known key found for this signature in database
GPG key ID: 67715A371E534061
3 changed files with 8 additions and 3 deletions

View file

@ -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"]

View file

@ -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::{

View file

@ -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 }