jashkenas/coffeescript

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

Open

#5.222 geöffnet am 18. Juli 2019

Auf GitHub ansehen
 (1 Kommentar) (5 Reaktionen) (0 zugewiesene Personen)CoffeeScript (1.980 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (16.577 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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.

Contributor Guide