maxtaco / coffee-script

IcedCoffeeScript
http://maxtaco.github.com/coffee-script
MIT License
727 stars 58 forks source link

ReferenceError: l is not defined. #79

Closed wpoosanguansit closed 11 years ago

wpoosanguansit commented 11 years ago

I am using the latest version 1.6.3. And the coffeescript code is:

logger.error("Error at - call method: error in Method.distinct - %s", err) if err

It compiles to:

if (err(l)) { logger.error("Error at - call method: error in Method.distinct - %s", err); }

The strange thing is I have this code pattern all over the place but it fails only here. Thanks for your help.

zapu commented 11 years ago

I can't reproduce (on Windows)

>cat referr.iced
logger.error("Error at - call method: error in Method.distinct - %s", err) if err
>iced -v
IcedCoffeeScript version 1.6.3-d
>iced -p referr.iced
(function() {

  if (err) {
    logger.error("Error at - call method: error in Method.distinct - %s", err);
  }

}).call(this);

Can you reproduce it using just the code snippet you posted?

maxtaco commented 11 years ago

Can't reproduce and I don't see how this would happen!