1
0
Fork 0
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:
Tim-Smart 2010-09-23 14:41:38 +12:00
parent dfd6025d04
commit c4a3e170e2

View file

@ -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.