mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 02:29:04 +03:00
test(es/compat): Add a test to verify parameters passs (#6792)
**Related issue:** - Closes https://github.com/swc-project/swc/issues/6790.
This commit is contained in:
parent
288ec1d6e0
commit
7dc5ccb0fc
@ -1,3 +1,5 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use swc_common::{chain, comments::SingleThreadedComments, Mark};
|
||||
use swc_ecma_parser::Syntax;
|
||||
use swc_ecma_transforms_base::resolver;
|
||||
@ -7,7 +9,7 @@ use swc_ecma_transforms_compat::{
|
||||
},
|
||||
es2017::async_to_generator,
|
||||
};
|
||||
use swc_ecma_transforms_testing::{test, test_exec};
|
||||
use swc_ecma_transforms_testing::{test, test_exec, test_fixture};
|
||||
use swc_ecma_visit::Fold;
|
||||
|
||||
fn syntax() -> Syntax {
|
||||
@ -2308,3 +2310,22 @@ test!(
|
||||
console.log(v0(1, 2, 'hello', true, 7));
|
||||
"#
|
||||
);
|
||||
|
||||
#[testing::fixture("tests/parameters/**/input.js")]
|
||||
fn fixture(input: PathBuf) {
|
||||
let output = input.with_file_name("output.js");
|
||||
|
||||
test_fixture(
|
||||
Default::default(),
|
||||
&|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, Mark::new(), false),
|
||||
parameters(Default::default(), unresolved_mark)
|
||||
)
|
||||
},
|
||||
&input,
|
||||
&output,
|
||||
Default::default(),
|
||||
);
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
async function internalMutate(...args) {
|
||||
const [cache, _key, _data, _opts] = args;
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
async function internalMutate() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
const [cache, _key1, _data, _opts] = args;
|
||||
}
|
Loading…
Reference in New Issue
Block a user