jashkenas/coffeescript

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

Open

#5,222 创建于 2019年7月18日

在 GitHub 查看
 (1 评论) (5 反应) (0 负责人)CoffeeScript (1,980 fork)batch import
bughelp wanted

仓库指标

Star
 (16,577 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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.

贡献者指南