All files / src/compiler state.js

100% Statements 24/24
100% Branches 1/1
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 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 4944x 4944x 4944x 4944x  
import { getLocator } from 'locate-character';
 
/** @typedef {{ start?: number, end?: number }} NodeLike */
 
/** @type {import('#compiler').Warning[]} */
export let warnings = [];
 
/** @type {string | undefined} */
export let filename;
 
export let locator = getLocator('', { offsetLine: 1 });
 
/**
 * @param {{
 *   source: string;
 *   filename: string | undefined;
 * }} options
 */
export function reset(options) {
	filename = options.filename;
	locator = getLocator(options.source, { offsetLine: 1 });
	warnings = [];
}