Update error

This commit is contained in:
Jordan Pittman 2025-11-10 11:38:11 -05:00
parent e18642a616
commit bb628d7cc9
2 changed files with 3 additions and 3 deletions

View file

@ -1193,7 +1193,7 @@ describe.each(['Unix', 'Windows'])('Line endings: %s', (lineEndings) => {
/* ^ Missing closing } */
`),
).toThrowErrorMatchingInlineSnapshot(
`[CssSyntaxError: input.css: 7:12: Missing closing } at .bar]`,
`[CssSyntaxError: input.css: 6:10: Missing closing } at .bar]`,
)
})

View file

@ -574,14 +574,14 @@ export function parse(input: string, opts?: ParseOptions) {
if (parent.kind === 'rule') {
throw new CssSyntaxError(
`Missing closing } at ${parent.selector}`,
source ? [source, bufferStart, bufferStart] : null,
parent.src ? [parent.src[0], parent.src[1], parent.src[1]] : null,
)
}
if (parent.kind === 'at-rule') {
throw new CssSyntaxError(
`Missing closing } at ${parent.name} ${parent.params}`,
source ? [source, bufferStart, bufferStart] : null,
parent.src ? [parent.src[0], parent.src[1], parent.src[1]] : null,
)
}
}