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

100% Statements 24/24
100% Branches 6/6
100% Functions 1/1
100% Lines 23/23

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 242x 2x 2x 2x 2x 2x 2x 2x 2x 2446x 2446x 2446x 77x 2446x 27x 27x 27x 1x 1x 27x 2445x 2445x 2445x  
/** @import { MemberExpression } from 'estree' */
/** @import { Context } from '../types.js' */
import * as b from '../../../../utils/builders.js';
 
/**
 * @param {MemberExpression} node
 * @param {Context} context
 */
export function MemberExpression(node, context) {
	if (
		context.state.analysis.runes &&
		node.object.type === 'ThisExpression' &&
		node.property.type === 'PrivateIdentifier'
	) {
		const field = context.state.private_derived.get(node.property.name);
 
		if (field) {
			return b.call(node);
		}
	}
 
	context.next();
}