see if this fixes the prettier stuff

pull/9482/head
Rich Harris 3 years ago
parent 6bfedcf144
commit bfdd408623

@ -110,12 +110,14 @@ function open(parser) {
}
let assertion = null;
let end = expression.end;
expression = walk(expression, null, {
// @ts-expect-error
TSAsExpression(node, context) {
if (node.end === /** @type {import('estree').Expression} */ (expression).end) {
assertion = node;
end = node.expression.end;
return node.expression;
}
@ -123,6 +125,8 @@ function open(parser) {
}
});
expression.end = end;
if (assertion) {
// we can't reset `parser.index` to `expression.expression.end` because
// it will ignore any parentheses — we need to jump through this hoop

Loading…
Cancel
Save