From a133e018cc4d27eeec19a8296a7a0ce6f5d6552a Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Sat, 12 Jun 2010 11:09:30 -0400 Subject: [PATCH] Making the REPL the default behaviour of 'coffee', when called with no arguments, a-la Node and Python. --- lib/command.js | 2 +- src/command.coffee | 2 +- src/nodes.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/command.js b/lib/command.js index 12a1f1da..7258957a 100644 --- a/lib/command.js +++ b/lib/command.js @@ -43,7 +43,7 @@ return compile_script('console', sources[0]); } if (!(sources.length)) { - return usage(); + return require('./repl'); } separator = sources.indexOf('--'); flags = []; diff --git a/src/command.coffee b/src/command.coffee index 8b71ca16..93abc9f1 100644 --- a/src/command.coffee +++ b/src/command.coffee @@ -51,7 +51,7 @@ exports.run: -> return require './repl' if options.interactive return compile_stdio() if options.stdio return compile_script 'console', sources[0] if options.eval - return usage() unless sources.length + return require './repl' unless sources.length separator: sources.indexOf '--' flags: [] if separator >= 0 diff --git a/src/nodes.coffee b/src/nodes.coffee index f6882915..45157bc9 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -1395,7 +1395,7 @@ UTILITIES: { # Shortcuts to speed up the lookup time for native functions. __hasProp: 'Object.prototype.hasOwnProperty' - __slice: 'Array.prototype.slice' + __slice: 'Array.prototype.slice' }