File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
packages/svelte/src/compiler/phases/3-transform/client/visitors Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,8 @@ export function CallExpression(node, context) {
4747 parent ?. left ?. type === 'MemberExpression' &&
4848 context . state . in_constructor
4949 ) {
50- /** @type {ClassDeclaration | ClassExpression } */
51- const constructor = /** @type {ClassDeclaration | ClassExpression } */ (
52- context . path . findLast ( ( parent ) => parent . type . match ( / ^ C l a s s ( D e c l a r a t i o n | E x p r e s s i o n ) $ / ) )
50+ const constructor = context . path . findLast (
51+ ( parent ) => parent . type === 'ClassDeclaration' || parent . type === 'ClassExpression'
5352 ) ;
5453 const property = get_name ( parent . left . property ) ;
5554 source_tag = `${ constructor ?. id ?. name ?? '[class]' } .${ property } ` ;
@@ -70,9 +69,8 @@ export function CallExpression(node, context) {
7069 parent ?. left ?. type === 'MemberExpression' &&
7170 context . state . in_constructor
7271 ) {
73- /** @type {ClassDeclaration | ClassExpression } */
74- const constructor = /** @type {ClassDeclaration | ClassExpression } */ (
75- context . path . findLast ( ( parent ) => parent . type . match ( / ^ C l a s s ( D e c l a r a t i o n | E x p r e s s i o n ) $ / ) )
72+ const constructor = context . path . findLast (
73+ ( parent ) => parent . type === 'ClassDeclaration' || parent . type === 'ClassExpression'
7674 ) ;
7775 const property = get_name ( parent . left . property ) ;
7876 source_tag = `${ constructor ?. id ?. name ?? '[class]' } .${ property } ` ;
You can’t perform that action at this time.
0 commit comments