jashkenas/coffeescript

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

Open

#5,222 opened on 2019年7月18日

GitHub で見る
 (1 comment) (5 reactions) (0 assignees)CoffeeScript (16,577 stars) (1,980 forks)batch import
bughelp wanted

説明

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.

コントリビューターガイド

Bug: Wrong `this` in bound methods of nested classes · jashkenas/coffeescript#5222 | Good First Issue