Unverified Commit 466c19a9 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

test(turbopack): cover no-side-effects callback arguments

Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent 52613867
...@@ -1616,11 +1616,23 @@ mod tests { ...@@ -1616,11 +1616,23 @@ mod tests {
"const { fn } = /*#__NO_SIDE_EFFECTS__*/ other; fn();" "const { fn } = /*#__NO_SIDE_EFFECTS__*/ other; fn();"
); );
no_side_effects!(
test_no_side_effects_annotation_does_not_invoke_callbacks,
"const fn = /*#__NO_SIDE_EFFECTS__*/ other;
fn(() => console.log('arrow'), function () { console.log('function'); });"
);
side_effects!( side_effects!(
test_no_side_effects_annotation_still_checks_arguments, test_no_side_effects_annotation_still_checks_arguments,
"const fn = /*#__NO_SIDE_EFFECTS__*/ other; fn(sideEffect());" "const fn = /*#__NO_SIDE_EFFECTS__*/ other; fn(sideEffect());"
); );
side_effects!(
test_no_side_effects_annotation_callback_argument_evaluation,
"const fn = /*#__NO_SIDE_EFFECTS__*/ other;
fn(() => console.log('callback'), sideEffect());"
);
side_effects!( side_effects!(
test_no_side_effects_annotation_does_not_purify_initializer, test_no_side_effects_annotation_does_not_purify_initializer,
"const fn = /*#__NO_SIDE_EFFECTS__*/ getFn();" "const fn = /*#__NO_SIDE_EFFECTS__*/ getFn();"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment