Merge pull request #3107 from mal/issue2957

Fork with binary of coffee-script in use, rather than global
This commit is contained in:
Michael Ficarra 2013-08-02 15:44:55 -07:00
commit 15517df417
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
// Generated by CoffeeScript 1.6.3
(function() {
var Lexer, Module, SourceMap, child_process, compile, compileFile, ext, fileExtensions, findExtension, fork, formatSourcePosition, fs, getSourceMap, helpers, lexer, loadFile, parser, path, sourceMaps, vm, withPrettyErrors, _i, _len,
var Lexer, Module, SourceMap, binary, child_process, compile, compileFile, ext, fileExtensions, findExtension, fork, formatSourcePosition, fs, getSourceMap, helpers, lexer, loadFile, parser, path, sourceMaps, vm, withPrettyErrors, _i, _len,
__hasProp = {}.hasOwnProperty,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
@ -22,6 +22,8 @@
exports.VERSION = '1.6.3';
binary = require.resolve('../../bin/coffee');
fileExtensions = ['.coffee', '.litcoffee', '.coffee.md'];
exports.helpers = helpers;
@ -241,7 +243,7 @@
if (options == null) {
options = {};
}
execPath = helpers.isCoffee(path) ? 'coffee' : null;
execPath = helpers.isCoffee(path) ? binary : null;
if (!Array.isArray(args)) {
args = [];
options = args || {};

View File

@ -15,6 +15,7 @@ SourceMap = require './sourcemap'
# The current CoffeeScript version number.
exports.VERSION = '1.6.3'
binary = require.resolve '../../bin/coffee'
fileExtensions = ['.coffee', '.litcoffee', '.coffee.md']
# Expose helpers for testing.
@ -202,7 +203,7 @@ if require.extensions
if child_process
{fork} = child_process
child_process.fork = (path, args = [], options = {}) ->
execPath = if helpers.isCoffee(path) then 'coffee' else null
execPath = if helpers.isCoffee(path) then binary else null
if not Array.isArray args
args = []
options = args or {}