jashkenas / coffeescript

Unfancy JavaScript
https://coffeescript.org/
MIT License
16.52k stars 1.98k forks source link

compiler option to use ES5 bind method. #1363

Closed krisnye closed 7 years ago

krisnye commented 13 years ago

current output is a __bind method and this:

__bind(function() {}, this)

desired output with a new compiler option set would be this:

function(){}.bind(this)

GeoffreyBooth commented 7 years ago

CoffeeScript 2 targets ES2015. Part of its goal is to remove old shims and polyfills, and use modern ES syntax wherever possible. Pull requests to help modernize are welcome, against the 2 branch.