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

100% Statements 20/20
100% Branches 5/5
100% Functions 1/1
100% Lines 18/18

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 192x 2x 2x 2x 2x 2x 2x 2x 2x 2x 1451x 1451x 1451x 81x 81x 1370x 1370x 1370x  
/** @import { ExpressionStatement } from 'estree' */
/** @import { Context } from '../types.js' */
import * as b from '../../../../utils/builders.js';
import { get_rune } from '../../../scope.js';
 
/**
 * @param {ExpressionStatement} node
 * @param {Context} context
 */
export function ExpressionStatement(node, context) {
	const rune = get_rune(node.expression, context.state.scope);
 
	if (rune === '$effect' || rune === '$effect.pre' || rune === '$effect.root') {
		return b.empty;
	}
 
	context.next();
}