|
|
|
@ -154,17 +154,6 @@ export const javascript_visitors_runes = {
|
|
|
|
|
|
|
|
|
|
return { ...node, body };
|
|
|
|
|
},
|
|
|
|
|
ReturnStatement(node, { state, visit, next }) {
|
|
|
|
|
const rune = get_rune(node.argument, state.scope);
|
|
|
|
|
if (rune === '$state' && node.argument?.type === 'CallExpression') {
|
|
|
|
|
const value = /** @type {import('estree').Expression} **/ (visit(node.argument.arguments[0]));
|
|
|
|
|
return {
|
|
|
|
|
...node,
|
|
|
|
|
argument: b.call('$.proxy', value)
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
next();
|
|
|
|
|
},
|
|
|
|
|
VariableDeclaration(node, { state, visit }) {
|
|
|
|
|
const declarations = [];
|
|
|
|
|
|
|
|
|
@ -373,6 +362,11 @@ export const javascript_visitors_runes = {
|
|
|
|
|
return transform_inspect_rune(node, context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (rune === '$state') {
|
|
|
|
|
const value = /** @type {import('estree').Expression} **/ (context.visit(node.arguments[0]));
|
|
|
|
|
return b.call('$.proxy', value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
context.next();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|