Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed broken compilation due to pull #2430

  • Loading branch information...
commit 5d7a83468abce3abe5ac236342201dd3ce6653a7 1 parent a396837
@michaelficarra michaelficarra authored
Showing with 5 additions and 5 deletions.
  1. +3 −3 lib/coffee-script/coffee-script.js
  2. +2 −2 src/coffee-script.coffee
View
6 lib/coffee-script/coffee-script.js
@@ -14,7 +14,7 @@
vm = require('vm');
stripBOM = function(content) {
- if (content.charCodeAt(0 === 0xFEFF)) {
+ if (content.charCodeAt(0) === 0xFEFF) {
return content.substring(1);
} else {
return content;
@@ -24,9 +24,9 @@
if (require.extensions) {
require.extensions['.coffee'] = function(module, filename) {
var content;
- content = compile(stripBOM(fs.readFileSync(filename, 'utf8'), {
+ content = compile(stripBOM(fs.readFileSync(filename, 'utf8')), {
filename: filename
- }));
+ });
return module._compile(content, filename);
};
} else if (require.registerExtension) {
View
4 src/coffee-script.coffee
@@ -13,12 +13,12 @@ path = require 'path'
vm = require 'vm'
stripBOM = (content) ->
- if content.charCodeAt 0 is 0xFEFF then content.substring 1 else content
+ if content.charCodeAt(0) is 0xFEFF then content.substring 1 else content
# TODO: Remove registerExtension when fully deprecated.
if require.extensions
require.extensions['.coffee'] = (module, filename) ->
- content = compile stripBOM fs.readFileSync(filename, 'utf8'), {filename}
+ content = compile stripBOM(fs.readFileSync filename, 'utf8'), {filename}
module._compile content, filename
else if require.registerExtension
require.registerExtension '.coffee', (content) -> compile content

2 comments on commit 5d7a834

@domenic

Oh how embarrassing -_-. I am just not smart enough to do paren-less function calls, I think. Thanks for the save @michaelficarra.

@andrewrk

I generally avoid paren-less calls unless the last argument is a callback. The paren-ful code is much more readable.

Please sign in to comment.
Something went wrong with that request. Please try again.