|
|
|
@ -45,7 +45,7 @@ export function VariableDeclaration(node, context) {
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
const right = node.right.arguments.length
|
|
|
|
const right = node.right.arguments.length
|
|
|
|
? /** @type {Expression} */ (context.visit(node.right.arguments[0]))
|
|
|
|
? /** @type {Expression} */ (context.visit(node.right.arguments[0]))
|
|
|
|
: b.id('undefined');
|
|
|
|
: b.unary('void', b.literal(0));
|
|
|
|
return b.assignment_pattern(node.left, right);
|
|
|
|
return b.assignment_pattern(node.left, right);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -76,7 +76,7 @@ export function VariableDeclaration(node, context) {
|
|
|
|
|
|
|
|
|
|
|
|
const args = /** @type {CallExpression} */ (init).arguments;
|
|
|
|
const args = /** @type {CallExpression} */ (init).arguments;
|
|
|
|
const value =
|
|
|
|
const value =
|
|
|
|
args.length === 0 ? b.id('undefined') : /** @type {Expression} */ (context.visit(args[0]));
|
|
|
|
args.length === 0 ? b.unary('void', b.literal(0)) : /** @type {Expression} */ (context.visit(args[0]));
|
|
|
|
|
|
|
|
|
|
|
|
if (rune === '$derived.by') {
|
|
|
|
if (rune === '$derived.by') {
|
|
|
|
declarations.push(
|
|
|
|
declarations.push(
|
|
|
|
|