|
|
|
@ -2,22 +2,9 @@ import { get_rune } from '../../../scope.js';
|
|
|
|
|
import { is_hoistable_function } from '../../utils.js';
|
|
|
|
|
import * as b from '../../../../utils/builders.js';
|
|
|
|
|
import * as assert from '../../../../utils/assert.js';
|
|
|
|
|
import { create_state_declarators, get_props_method } from '../utils.js';
|
|
|
|
|
import { create_state_declarators, get_props_method, should_proxy } from '../utils.js';
|
|
|
|
|
import { unwrap_ts_expression } from '../../../../utils/ast.js';
|
|
|
|
|
|
|
|
|
|
/** @param {import('estree').Expression} node */
|
|
|
|
|
function should_proxy(node) {
|
|
|
|
|
if (
|
|
|
|
|
node.type === 'Literal' ||
|
|
|
|
|
node.type === 'ArrowFunctionExpression' ||
|
|
|
|
|
node.type === 'FunctionExpression'
|
|
|
|
|
) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** @type {import('../types.js').ComponentVisitors} */
|
|
|
|
|
export const javascript_visitors_runes = {
|
|
|
|
|
ClassBody(node, { state, visit }) {
|
|
|
|
|