From 48c7debe5a9045f6b7f437e4664fba2b1440ae26 Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Wed, 7 Jun 2017 19:37:25 +0100 Subject: [PATCH] Fix REPL assignment (#4559) --- lib/coffee-script/repl.js | 2 +- src/repl.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coffee-script/repl.js b/lib/coffee-script/repl.js index 70db9f6ae3..86ac0af9f2 100644 --- a/lib/coffee-script/repl.js +++ b/lib/coffee-script/repl.js @@ -38,7 +38,7 @@ return results; })(); ast = CoffeeScript.nodes(tokens); - ast = new Block([new Assign(new Value(new Literal('_')), ast, '=')]); + ast = new Block([new Assign(new Value(new Literal('__')), ast, '=')]); js = ast.compile({ bare: true, locals: Object.keys(context), diff --git a/src/repl.coffee b/src/repl.coffee index 0b9b1619ac..4d34eb6494 100644 --- a/src/repl.coffee +++ b/src/repl.coffee @@ -33,7 +33,7 @@ replDefaults = ast = CoffeeScript.nodes tokens # Add assignment to `_` variable to force the input to be an expression. ast = new Block [ - new Assign (new Value new Literal '_'), ast, '=' + new Assign (new Value new Literal '__'), ast, '=' ] js = ast.compile {bare: yes, locals: Object.keys(context), referencedVars} cb null, runInContext js, context, filename