|
|
@ -1775,7 +1775,7 @@ export const template_visitors = {
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('estree').Expression[]} */
|
|
|
|
/** @type {import('estree').Expression[]} */
|
|
|
|
const args = [context.state.node];
|
|
|
|
const args = [context.state.node];
|
|
|
|
node.arguments.forEach((arg) => {
|
|
|
|
for (const arg of node.arguments) {
|
|
|
|
if (arg.type === 'SpreadElement') {
|
|
|
|
if (arg.type === 'SpreadElement') {
|
|
|
|
// this is a spread operation, meaning we need to thunkify all of its members, which we can't
|
|
|
|
// this is a spread operation, meaning we need to thunkify all of its members, which we can't
|
|
|
|
// do until runtime
|
|
|
|
// do until runtime
|
|
|
@ -1787,7 +1787,7 @@ export const template_visitors = {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
args.push(b.thunk(/** @type {import('estree').Expression} */ (context.visit(arg))));
|
|
|
|
args.push(b.thunk(/** @type {import('estree').Expression} */ (context.visit(arg))));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let snippet_function = /** @type {import('estree').Expression} */ (
|
|
|
|
let snippet_function = /** @type {import('estree').Expression} */ (
|
|
|
|
context.visit(node.expression)
|
|
|
|
context.visit(node.expression)
|
|
|
@ -2483,7 +2483,9 @@ export const template_visitors = {
|
|
|
|
/** @type {import('estree').Statement[]} */
|
|
|
|
/** @type {import('estree').Statement[]} */
|
|
|
|
const declarations = [];
|
|
|
|
const declarations = [];
|
|
|
|
|
|
|
|
|
|
|
|
node.context.elements.forEach((argument, i) => {
|
|
|
|
for (let i = 0; i < node.context.elements.length; i++) {
|
|
|
|
|
|
|
|
const argument = node.context.elements[i];
|
|
|
|
|
|
|
|
|
|
|
|
if (!argument) return;
|
|
|
|
if (!argument) return;
|
|
|
|
|
|
|
|
|
|
|
|
if (argument.type === 'Identifier') {
|
|
|
|
if (argument.type === 'Identifier') {
|
|
|
@ -2547,7 +2549,7 @@ export const template_visitors = {
|
|
|
|
|
|
|
|
|
|
|
|
binding.expression = b.call(name);
|
|
|
|
binding.expression = b.call(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
body = b.block([
|
|
|
|
body = b.block([
|
|
|
|
...declarations,
|
|
|
|
...declarations,
|
|
|
|