mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Support for older revisions of Node.js for CoffeeScript.run()
This commit is contained in:
parent
dfd6025d04
commit
c4a3e170e2
1 changed files with 4 additions and 1 deletions
|
@ -54,7 +54,10 @@ exports.run = (code, options) ->
|
|||
# Clear the module cache
|
||||
root.moduleCache = {} if root.moduleCache
|
||||
# Compile
|
||||
root._compile exports.compile(code, options), root.filename
|
||||
if path.extname(root.filename) isnt '.coffee' or require.extensions
|
||||
root._compile exports.compile(code, options), root.filename
|
||||
else
|
||||
root._compile code, root.filename
|
||||
|
||||
# Compile and evaluate a string of CoffeeScript (in a Node.js-like environment).
|
||||
# The CoffeeScript REPL uses this to run the input.
|
||||
|
|
Loading…
Reference in a new issue