Skip to content

Instantly share code, notes, and snippets.

@dbrans
Created May 16, 2011 03:23
Show Gist options
  • Save dbrans/973880 to your computer and use it in GitHub Desktop.
Save dbrans/973880 to your computer and use it in GitHub Desktop.
CoffeeScript Bug: binding class methods with reserved names
class Test
export: =>
The js compilation I get is this (note the ' this."export" ')
var Test;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
Test = (function() {
function Test() {
this."export" = __bind(this."export", this);
}
Test.prototype["export"] = function() {};
return Test;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment