Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion tasks/benchmark/benches/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ fn bench_codegen(criterion: &mut Criterion) {
assert!(parser_ret.errors.is_empty());
let mut program = parser_ret.program;

let scoping = SemanticBuilder::new().build(&program).semantic.into_scoping();
let scoping =
SemanticBuilder::new().with_enum_eval(true).build(&program).semantic.into_scoping();

let transform_options = TransformOptions::enable_all();
let transformer_ret =
Expand Down
6 changes: 5 additions & 1 deletion tasks/benchmark/benches/minifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ fn bench_minifier(criterion: &mut Criterion) {

// Create fresh AST + semantic data for each iteration
let mut program = Parser::new(&allocator, source_text, source_type).parse().program;
let scoping = SemanticBuilder::new().build(&program).semantic.into_scoping();
let scoping = SemanticBuilder::new()
.with_enum_eval(true)
.build(&program)
.semantic
.into_scoping();

// Minifier only works on esnext.
let transform_options = TransformOptions::from_target("esnext").unwrap();
Expand Down
1 change: 1 addition & 0 deletions tasks/benchmark/benches/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ fn bench_pipeline(criterion: &mut Criterion) {
// Semantic
let scoping = SemanticBuilder::new()
.with_excess_capacity(2.0)
.with_enum_eval(true)
.build(&program)
.semantic
.into_scoping();
Expand Down
1 change: 1 addition & 0 deletions tasks/benchmark/benches/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fn bench_transformer(criterion: &mut Criterion) {
let scoping = SemanticBuilder::new()
// Estimate transformer will triple scopes, symbols, references
.with_excess_capacity(2.0)
.with_enum_eval(true)
.build(&program)
.semantic
.into_scoping();
Expand Down
12 changes: 10 additions & 2 deletions tasks/track_memory_allocations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ pub fn run() -> Result<(), io::Error> {
assert!(parsed.errors.is_empty());

// Transform TypeScript to ESNext before minifying (minifier only works on esnext)
let scoping = SemanticBuilder::new().build(&parsed.program).semantic.into_scoping();
let scoping = SemanticBuilder::new()
.with_enum_eval(true)
.build(&parsed.program)
.semantic
.into_scoping();
let transform_options = TransformOptions::from_target("esnext").unwrap();
let _ =
Transformer::new(&allocator, std::path::Path::new(&file.file_name), &transform_options)
Expand Down Expand Up @@ -194,7 +198,11 @@ pub fn run() -> Result<(), io::Error> {
));

let (scoping, semantic_stats) = record_stats_in(&allocator, || {
SemanticBuilder::new().build(&parsed.program).semantic.into_scoping()
SemanticBuilder::new()
.with_enum_eval(true)
.build(&parsed.program)
.semantic
.into_scoping()
});

semantic_out.push_str(&format_table_row(
Expand Down
Loading