|
1 | | -/** @import { CallExpression, ClassDeclaration, ClassExpression, Expression } from 'estree' */ |
| 1 | +/** @import { AssignmentExpression, CallExpression, Expression } from 'estree' */ |
2 | 2 | /** @import { Context } from '../types' */ |
3 | 3 | import { dev, is_ignored } from '../../../../state.js'; |
4 | 4 | import * as b from '#compiler/builders'; |
@@ -39,44 +39,16 @@ export function CallExpression(node, context) { |
39 | 39 | value = b.call('$.proxy', value); |
40 | 40 | } |
41 | 41 | } |
42 | | - let source_tag; |
43 | | - const parent = context.path.at(-1); |
44 | | - if ( |
45 | | - dev && |
46 | | - parent?.type === 'AssignmentExpression' && |
47 | | - parent?.left?.type === 'MemberExpression' && |
48 | | - context.state.in_constructor |
49 | | - ) { |
50 | | - const constructor = context.path.findLast( |
51 | | - (parent) => parent.type === 'ClassDeclaration' || parent.type === 'ClassExpression' |
52 | | - ); |
53 | | - const property = get_name(parent.left.property); |
54 | | - source_tag = `${constructor?.id?.name ?? '[class]'}.${property}`; |
55 | | - } |
56 | | - const call = b.call('$.state', value); |
57 | | - return dev ? b.call('$.tag', call, b.literal(/** @type {string} */ (source_tag))) : call; |
| 42 | + |
| 43 | + return b.call('$.state', value); |
58 | 44 | } |
59 | 45 |
|
60 | 46 | case '$derived': |
61 | 47 | case '$derived.by': { |
62 | 48 | let fn = /** @type {Expression} */ (context.visit(node.arguments[0])); |
63 | 49 | if (rune === '$derived') fn = b.thunk(fn); |
64 | | - let source_tag; |
65 | | - const parent = context.path.at(-1); |
66 | | - if ( |
67 | | - dev && |
68 | | - parent?.type === 'AssignmentExpression' && |
69 | | - parent?.left?.type === 'MemberExpression' && |
70 | | - context.state.in_constructor |
71 | | - ) { |
72 | | - const constructor = context.path.findLast( |
73 | | - (parent) => parent.type === 'ClassDeclaration' || parent.type === 'ClassExpression' |
74 | | - ); |
75 | | - const property = get_name(parent.left.property); |
76 | | - source_tag = `${constructor?.id?.name ?? '[class]'}.${property}`; |
77 | | - } |
78 | | - const call = b.call('$.derived', fn); |
79 | | - return dev ? b.call('$.tag', call, b.literal(/** @type {string} */ (source_tag))) : call; |
| 50 | + |
| 51 | + return b.call('$.derived', fn); |
80 | 52 | } |
81 | 53 |
|
82 | 54 | case '$state.snapshot': |
|
0 commit comments