Coffeescript compile error -


i installed coffeescript , tried test compile drop me errors silly things, coffeescript compile correctly when coffeescript syntax used?

because if yes understand error.enter image description here

concdev.js contents:

/*! projectname 2013-08-18 06:08:39 */ $(function() {    // avoid `console` errors in browsers lack console.   (function() {       var method;       var noop = function () {};       var methods = [           'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',           'exception', 'group', 'groupcollapsed', 'groupend', 'info', 'log',           'marktimeline', 'profile', 'profileend', 'table', 'time', 'timeend',           'timestamp', 'trace', 'warn'       ];       var length = methods.length;       var console = (window.console = window.console || {});        while (length--) {           method = methods[length];            // stub undefined methods.           if (!console[method]) {               console[method] = noop;           }       }   }());  }); // new file $(function() {    // handler .ready() called.  }); 

you can't use c style comments in coffeescript.

this

/*! project name ...*/ 

should this

# project name ... 

more generally, if you're using coffeescript compiler, need valid coffeescript syntax , can't mix , match js , coffeescript files.

update

you're trying pass js file coffeescript compiler. coffee compiler accepts coffeescript file, , compiles js file. file in coffeescript this:

#! projectname 2013-08-18 06:08:39 */ $ ->    # avoid `console` errors in browsers lack console.    ->       noop = -> null       methods = [           'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',           'exception', 'group', 'groupcollapsed', 'groupend', 'info', 'log',           'marktimeline', 'profile', 'profileend', 'table', 'time', 'timeend',           'timestamp', 'trace', 'warn'       ]       length = methods.length       console = window.console = window.console || {}        while length--           method = methods[length]           # stub undefined methods.           if !console[method]               console[method] = noop; // new file $ ->   #handler .ready() called. 

if need have js in coffeescript file, can embed using backticks this

a = `(function() x{ return 2;})()` 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo