-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hello,
Node 17.0.1, code:
const { refactor } = require('shift-refactor');
const code = '! function(a,b,c){ a = 1, b = 2, c = 3, console.log(200)}()';
const secondExpression = "Script > ExpressionStatement > UnaryExpression > CallExpression > FunctionExpression > FunctionBody > ExpressionStatement > .expression > .left > .left > .right";
const fs = require("fs");
var $script = refactor(code);
$script(secondExpression).delete();
console.log($script.print());
Shows error:
_\node_modules\shift-reducer\dist\director.js:68
return reducer.reduceBinaryExpression(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right) });
^TypeError: Cannot read properties of null (reading 'type')_
Am I doing anything wrong? Please advise.
PS. Thank you for your great videos, hope you'll continue to make them someday.
Metadata
Metadata
Assignees
Labels
No labels