Closed tanepiper closed 13 years ago
fwiw, the workaround is to add it through a script tag
script "__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };"
or maybe just include underscore.js
Same thing for me, I'm too new to CS to know when/why it decides to generate the bind function, but I would guess that the compiler thinks it's already generated? (p.s. Thanks for the workaround!)
I fixed this in 0.2.4beta by including all coffeescript helpers in code generated by the coffeescript
"tag". But maybe it's a better idea to keep the original behavior of generating "clean" code and requiring the addition of the helpers manually. What do you guys think?
I prefer the automatic code generation. I noticed another of these popped up when I did an "if x in y" so it will be nice to have that work as well without tinkering.
Automatic it remains then. After all, now thinking, 635 bytes are not that of an issue.
In my coffeescript code, within my coffeekup template, => does not generate the __bind function within the script tag.
For example:
Exception thrown is Uncaught ReferenceError: __bind is not defined
The output is