maxtaco / coffee-script

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

`Q.defer()` causes a `ReferenceError: __iced_deferrals is not defined`. #91

Closed vjpr closed 10 years ago

vjpr commented 10 years ago

def = Q.defer() compiles to

var def;

def = Q.defer({
  lineno: 0,
  context: __iced_deferrals
});

which causes a ReferenceError: __iced_deferrals is not defined.

If defer is a property of an object it shouldn't be icefied.

maxtaco commented 10 years ago

This is an annoyance for sure, but now defer is a keyword, and I sometimes use it as a property of an object, unfortunately (see Rendezvous and friends for an example). The workaround I suggest is something like

def = Q["defer"].apply(Q, [])