-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(es/transforms): Allocate stacks dynamically (#8867)
**Description:** - This PR introduces an in-tree testing system for Deno. - This PR adds `stacker` cargo-feature to `swc_ecma_utils`. **Related issue:** - #1627 - Closes #8840
- Loading branch information
Showing
25 changed files
with
5,569 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#![cfg(all( | ||
feature = "swc_ecma_transforms_proposal", | ||
feature = "swc_ecma_transforms_typescript", | ||
))] | ||
use std::path::PathBuf; | ||
|
||
use swc_common::{chain, Mark}; | ||
use swc_ecma_parser::Syntax; | ||
use swc_ecma_transforms::{fixer, helpers::inject_helpers, hygiene, resolver}; | ||
use swc_ecma_transforms_proposal::{ | ||
decorator_2022_03::decorator_2022_03, | ||
explicit_resource_management::explicit_resource_management, | ||
}; | ||
use swc_ecma_transforms_testing::test_fixture; | ||
use swc_ecma_transforms_typescript::typescript; | ||
|
||
#[testing::fixture("tests/fixture/deno/**/input.ts")] | ||
fn stack_overflow(input: PathBuf) { | ||
run_test(input); | ||
} | ||
|
||
fn run_test(input: PathBuf) { | ||
let output = input.with_file_name("output.js"); | ||
|
||
test_fixture( | ||
Syntax::Typescript(Default::default()), | ||
&|_tester| { | ||
let unresolved_mark = Mark::new(); | ||
let top_level_mark = Mark::new(); | ||
|
||
chain!( | ||
resolver(unresolved_mark, top_level_mark, true), | ||
decorator_2022_03(), | ||
explicit_resource_management(), | ||
inject_helpers(top_level_mark), | ||
typescript( | ||
typescript::Config { | ||
verbatim_module_syntax: false, | ||
import_not_used_as_values: typescript::ImportsNotUsedAsValues::Remove, | ||
no_empty_export: true, | ||
import_export_assign_config: | ||
typescript::TsImportExportAssignConfig::Preserve, | ||
ts_enum_is_mutable: true, | ||
}, | ||
top_level_mark | ||
), | ||
fixer(None), | ||
hygiene(), | ||
) | ||
}, | ||
&input, | ||
&output, | ||
Default::default(), | ||
) | ||
} |
Oops, something went wrong.