All files / src/compiler/phases/3-transform/server/visitors ExpressionStatement.js

100% Statements 30/30
100% Branches 9/9
100% Functions 1/1
100% Lines 29/29

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 302x 2x 2x 2x 2x 2x 2x 2x 2x 397x 397x 397x 213x 213x 213x 52x 52x 161x 161x 213x 213x 113x 213x 18x 18x 213x 327x 327x 327x  
/** @import { ExpressionStatement } from 'estree' */
/** @import { Context } from '../types.js' */
import * as b from '../../../../utils/builders.js';
 
/**
 * @param {ExpressionStatement} node
 * @param {Context} context
 */
export function ExpressionStatementRunes(node, context) {
	const expression = node.expression;
 
	if (expression.type === 'CallExpression') {
		const callee = expression.callee;
 
		if (callee.type === 'Identifier' && callee.name === '$effect') {
			return b.empty;
		}
 
		if (
			callee.type === 'MemberExpression' &&
			callee.object.type === 'Identifier' &&
			callee.object.name === '$effect'
		) {
			return b.empty;
		}
	}
 
	context.next();
}