This commit is contained in:
Felix Roos 2022-02-25 16:28:22 +01:00
parent 5fb31c2a9f
commit 9ccc78a929
11 changed files with 508 additions and 458 deletions

View file

@ -91,7 +91,9 @@ export default (code) => {
const isMarkable = isPatternArg(parents) || hasModifierCall(parent);
// add to location to pure(x) calls
if (node.type === 'CallExpression' && node.callee.name === 'pure') {
return reifyWithLocation(node.arguments[0].name, node.arguments[0], ast.locations, artificialNodes);
const literal = node.arguments[0];
const value = literal[{ LiteralNumericExpression: 'value', LiteralStringExpression: 'name' }[literal.type]];
return reifyWithLocation(value + '', node.arguments[0], ast.locations, artificialNodes);
}
// replace pseudo note variables
if (node.type === 'IdentifierExpression') {
@ -339,4 +341,3 @@ function getLocationObject(node, locations) {
],
};
}