Skip to content

Commit

Permalink
Remove paramater assignment
Browse files Browse the repository at this point in the history
Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>
  • Loading branch information
zabil committed Aug 22, 2024
1 parent 7854c2a commit 4d8022f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/repl/awaitEval.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,20 @@ const rewrite = (code) => {

const aEval = (oEval, cmdCallback) => (cmd, context, filename, callback) => {
const oCmd = cmd.trim();
let _cmd = cmd;
try {
cmd = rewrite(cmd);
_cmd = rewrite(cmd);
} catch (err) {
callback(err);
}
oEval.call(this, cmd, context, filename, async function (err, value) {
oEval.call(this, _cmd, context, filename, async function (err, value) {
if (err) {
callback.call(this, err, null);
} else {
try {
value = await value;
value = cmdCallback(oCmd, value);
callback.call(this, err, value);
let _value = await value;
_value = cmdCallback(oCmd, _value);
callback.call(this, err, _value);
} catch (error) {
callback.call(this, error, null);
}
Expand Down

0 comments on commit 4d8022f

Please sign in to comment.