fix: Turns out javascript parameters are optional

pull/10320/head
S. Elliott Johnson 10 months ago
parent bc917fe9a4
commit 106514514d

@ -2486,14 +2486,12 @@ export const template_visitors = {
node.context.elements.forEach((argument, i) => {
if (!argument) return;
const call = argument.type === 'AssignmentPattern' ? b.maybe_call : b.call;
if (argument.type === 'Identifier') {
args.push(argument);
const binding = /** @type {import('#compiler').Binding} */ (
context.state.scope.get(argument.name)
);
binding.expression = call(argument);
binding.expression = b.maybe_call(argument);
return;
}
@ -2528,7 +2526,7 @@ export const template_visitors = {
/** @type {import('estree').Expression} */ (
context.visit(
path.expression?.(
argument.type === 'RestElement' ? b.id(arg_alias) : call(arg_alias)
argument.type === 'RestElement' ? b.id(arg_alias) : b.maybe_call(arg_alias)
)
)
)

Loading…
Cancel
Save