@ -136,21 +136,24 @@ export function CallExpression(node, context) {
break ;
break ;
case '$inspect.trace' :
case '$inspect.trace' : {
if ( node . arguments . length !== 1 ) {
if ( node . arguments . length !== 1 ) {
e . rune _invalid _arguments _length ( node , rune , 'exactly one argument' ) ;
e . rune _invalid _arguments _length ( node , rune , 'exactly one argument' ) ;
}
}
if ( node . arguments [ 0 ] . type !== 'Literal' || typeof node . arguments [ 0 ] . value !== 'string' ) {
if ( node . arguments [ 0 ] . type !== 'Literal' || typeof node . arguments [ 0 ] . value !== 'string' ) {
e . trace _rune _invalid _argument ( node ) ;
e . trace _rune _invalid _argument ( node ) ;
}
}
const grand _parent = context . path . at ( - 2 ) ;
if (
if (
parent . type !== 'ExpressionStatement' ||
parent . type !== 'ExpressionStatement' ||
context. path . at ( - 2 ) ? . type !== 'BlockStatement' ||
grand_parent ? . type !== 'BlockStatement' ||
! (
! (
context . path . at ( - 3 ) ? . type === 'FunctionDeclaration' ||
context . path . at ( - 3 ) ? . type === 'FunctionDeclaration' ||
context . path . at ( - 3 ) ? . type === 'FunctionExpression' ||
context . path . at ( - 3 ) ? . type === 'FunctionExpression' ||
context . path . at ( - 3 ) ? . type === 'ArrowFunctionExpression'
context . path . at ( - 3 ) ? . type === 'ArrowFunctionExpression'
)
) ||
grand _parent . body [ 0 ] !== parent
) {
) {
e . trace _rune _invalid _location ( node ) ;
e . trace _rune _invalid _location ( node ) ;
}
}
@ -163,7 +166,7 @@ export function CallExpression(node, context) {
}
}
break ;
break ;
}
case '$state.snapshot' :
case '$state.snapshot' :
if ( node . arguments . length !== 1 ) {
if ( node . arguments . length !== 1 ) {
e . rune _invalid _arguments _length ( node , rune , 'exactly one argument' ) ;
e . rune _invalid _arguments _length ( node , rune , 'exactly one argument' ) ;