diff --git a/lib/coffee-script/coffee-script.js b/lib/coffee-script/coffee-script.js index d54a13c1..66429199 100644 --- a/lib/coffee-script/coffee-script.js +++ b/lib/coffee-script/coffee-script.js @@ -58,20 +58,21 @@ } }; exports.eval = function(code, options) { - var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref2, _ref3, _ref4, _require; + var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref2, _ref3, _require; if (options == null) options = {}; if (!(code = code.trim())) return; - if (_ref2 = require('vm'), Script = _ref2.Script, _ref2) { + Script = require('vm').Script; + if (Script) { sandbox = Script.createContext(); sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox; if (options.sandbox != null) { if (options.sandbox instanceof sandbox.constructor) { sandbox = options.sandbox; } else { - _ref3 = options.sandbox; - for (k in _ref3) { - if (!__hasProp.call(_ref3, k)) continue; - v = _ref3[k]; + _ref2 = options.sandbox; + for (k in _ref2) { + if (!__hasProp.call(_ref2, k)) continue; + v = _ref2[k]; sandbox[k] = v; } } @@ -85,9 +86,9 @@ return Module._load(path, _module); }; _module.filename = sandbox.__filename; - _ref4 = Object.getOwnPropertyNames(require); - for (_i = 0, _len = _ref4.length; _i < _len; _i++) { - r = _ref4[_i]; + _ref3 = Object.getOwnPropertyNames(require); + for (_i = 0, _len = _ref3.length; _i < _len; _i++) { + r = _ref3[_i]; if (r !== 'paths') _require[r] = require[r]; } _require.paths = _module.paths = Module._nodeModulePaths(process.cwd());