Skip to content

Instantly share code, notes, and snippets.

@benjie
Created March 12, 2013 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjie/5141899 to your computer and use it in GitHub Desktop.
Save benjie/5141899 to your computer and use it in GitHub Desktop.
Fat arrow binding inheritance bug in CoffeeScript 1.6.1

This bug has already been fixed in CoffeeScript master - I'd use 1.5.0 until an update to 1.6.1 is available.

To run this,

git clone git://github.com/jashkenas/coffee-script.git
cd coffee-script

Copy test.sh into the coffee-script directory, then

git bisect start
git checkout 1.6.1
git bisect bad
git checkout 1.5.0
git bisect good
git bisect run sh test.sh

Results:

running sh test.sh
Bisecting: 24 revisions left to test after this (roughly 4 steps)
[37a6ea63b16be5be7422002a64cab912e888b2e7] #2757, Allow non-significant commas at end of nested implicit objects
running sh test.sh
FAIL
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[3b25aea168b1941dec8d80067bd203d8af631881] When printing out --tokens, hide the location data.
running sh test.sh
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[b3452c12760e2b83ffcf1d74fa4961d422c002ab] Fixes #2508 -- existential access of the prototype.
running sh test.sh
Bisecting: 1 revision left to test after this (roughly 1 step)
[cf11a570e9c75a91e08f6e3dd98c289814a9d938] Fixes #2489, fixes #1819, fixes #1821 -- remove the __bind helper.
running sh test.sh
FAIL
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[9fe0e711d695e2c4070b9eb32d58e1ae49d11fe6] Fixes #2502 -- improper compilation with parenthesized inner value of instance properties in a class body.
running sh test.sh
cf11a570e9c75a91e08f6e3dd98c289814a9d938 is the first bad commit
commit cf11a570e9c75a91e08f6e3dd98c289814a9d938
Author: Jeremy Ashkenas <jashkenas@gmail.com>
Date:   Mon Mar 4 23:11:38 2013 +1300

    Fixes #2489, fixes #1819, fixes #1821 -- remove the __bind helper.

:040000 040000 936152b4ca4ed96a92b6534b78b5156413b6bad8 e1c4f81d5bd1181eb49ce1e329ea822c02898fdf M      lib
:040000 040000 c93f4845fb02cddb406f279100a59c115404a9a5 70729e0122f35338503cfe865846de30f8c021cc M      src
:040000 040000 ebe9be1ef85fd7e64a71903fbe77a6b74a54dac5 bab968a3813d6b3f46f01e58f8d3915911964a8b M      test
bisect run success
cat > test.coffee <<HERE
class A
m: => 1
class B extends A
m: => 2
result = new B().m() # Should be 2
if result isnt 2
console.error "FAIL"
process.exit 1
else
process.exit 0
HERE
bin/cake build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment