dont add location if addLocations is false

This commit is contained in:
Felix Roos
2022-06-16 11:48:00 +02:00
parent 5da2085436
commit a9995d185f
+1 -1
View File
@@ -89,7 +89,7 @@ export default (_code) => {
const isMarkable = isPatternArg(parents) || hasModifierCall(parent);
// add to location to pure(x) calls
if (node.type === 'CallExpression' && node.callee.name === 'pure') {
if (addLocations && node.type === 'CallExpression' && node.callee.name === 'pure') {
const literal = node.arguments[0];
// const value = literal[{ LiteralNumericExpression: 'value', LiteralStringExpression: 'name' }[literal.type]];
return reifyWithLocation(literal, node.arguments[0], ast.locations, artificialNodes);