Permalink
Browse files

Enable CoffeeScript by default.

To disable it use `nodify.useCoffeeScript = false`.
  • Loading branch information...
1 parent 4e15827 commit 4c4d53a2ded6fd3382ba1c309a79c3abde9ec950 @stas committed Apr 6, 2012
Showing with 5 additions and 7 deletions.
  1. +5 −7 nodify.js
View
@@ -26,7 +26,7 @@ var global = window, process;
var rootPath = fs.absolute(phantom.libraryPath);
var nodifyPath = joinPath(rootPath, dirname(nodify));
var sourceIds = {};
- nodify = { _useCoffeeScript: false };
+ nodify = { useCoffeeScript: true };
function getErrorMessage(e, withMessage) {
withMessage = typeof withMessage === 'undefined' ? true : withMessage;
@@ -75,7 +75,7 @@ var global = window, process;
joinPath(paths[i], 'lib', basename(paths[i]) + '.js')
]);
- if (nodify._useCoffeeScript) {
+ if (nodify.useCoffeeScript) {
fileGuesses.push.apply(fileGuesses, [
paths[i] + '.coffee',
joinPath(paths[i], path + '.coffee'),
@@ -263,6 +263,9 @@ var global = window, process;
};
// nodify
+
+ if (nodify.useCoffeeScript)
+ phantom.injectJs(joinPath(nodifyPath, 'coffee-script.js'));
patchRequire();
addProcess();
@@ -281,10 +284,5 @@ var global = window, process;
}
};
- nodify.enableCoffeeScript = function() {
- phantom.injectJs(joinPath(nodifyPath, 'coffee-script.js'));
- nodify._useCoffeeScript = true;
- };
-
}());

0 comments on commit 4c4d53a

Please sign in to comment.