jashkenas/coffeescript

Bug: Wrong `this` in bound methods of nested classes

Open

#5222 aperta il 18 lug 2019

Vedi su GitHub
 (1 commento) (5 reazioni) (0 assegnatari)CoffeeScript (1980 fork)batch import
bughelp wanted

Metriche repository

Star
 (16.577 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

While upgrading an application to CS2 we ran into the following issue in an obscure usage of nested classes.

Screenshot 2019-07-18 at 16 33 10

As you can see, the nested bound method thought its this is the parent class. This seems to happen on a "parse" level, because it's replaced in the code. This lead to tricky to catch bug on our side.

Guida contributor