Issue #2105 refined

Fix updated as suggested by michaelficarra
This commit is contained in:
Ken Gregson
2012-02-05 19:40:29 -05:00
parent 7becf808c7
commit cb0003d894
2 changed files with 3 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
// Generated by CoffeeScript 1.2.1-pre
(function() {
var ACCESSOR, CoffeeScript, Module, REPL_CHOMP, REPL_PROMPT, REPL_PROMPT_CONTINUATION, REPL_PROMPT_MULTILINE, SIMPLEVAR, Script, autocomplete, backlog, completeAttribute, completeVariable, enableColours, error, getCompletions, inspect, multilineMode, pipedInput, readline, repl, run, stdin, stdout;
var ACCESSOR, CoffeeScript, Module, REPL_PROMPT, REPL_PROMPT_CONTINUATION, REPL_PROMPT_MULTILINE, SIMPLEVAR, Script, autocomplete, backlog, completeAttribute, completeVariable, enableColours, error, getCompletions, inspect, multilineMode, pipedInput, readline, repl, run, stdin, stdout;
stdin = process.openStdin();
@@ -22,8 +22,6 @@
REPL_PROMPT_CONTINUATION = '......> ';
REPL_CHOMP = /(\n|\r)+$/;
enableColours = false;
if (process.platform !== 'win32') {
@@ -94,7 +92,7 @@
run = function(buffer) {
var code, returnValue, _;
buffer = buffer.replace(REPL_CHOMP, "");
buffer = buffer.replace(/[\r\n]+$/, "");
if (multilineMode) {
backlog += "" + buffer + "\n";
repl.setPrompt(REPL_PROMPT_CONTINUATION);

View File

@@ -21,7 +21,6 @@ Module = require 'module'
REPL_PROMPT = 'coffee> '
REPL_PROMPT_MULTILINE = '------> '
REPL_PROMPT_CONTINUATION = '......> '
REPL_CHOMP = /(\n|\r)+$/
enableColours = no
unless process.platform is 'win32'
enableColours = not process.env.NODE_DISABLE_COLORS
@@ -76,7 +75,7 @@ backlog = ''
# Attempt to evaluate the command. If there's an exception, print it out instead
# of exiting.
run = (buffer) ->
buffer = buffer.replace REPL_CHOMP, ""
buffer = buffer.replace /[\r\n]+$/, ""
if multilineMode
backlog += "#{buffer}\n"
repl.setPrompt REPL_PROMPT_CONTINUATION