mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
fixes issue #1464 ... bound class methods now keep context
This commit is contained in:
parent
9f89a83c27
commit
638dbbecbc
2 changed files with 2 additions and 2 deletions
|
@ -1065,7 +1065,7 @@
|
|||
if (!assign.variable["this"]) {
|
||||
assign.variable = new Value(new Literal(name), [new Access(base, 'proto')]);
|
||||
}
|
||||
if (func instanceof Code && func.bound) {
|
||||
if (func instanceof Code && func.bound && !assign.variable["this"]) {
|
||||
this.boundFuncs.push(base);
|
||||
func.bound = false;
|
||||
}
|
||||
|
|
|
@ -858,7 +858,7 @@ exports.Class = class Class extends Base
|
|||
else
|
||||
unless assign.variable.this
|
||||
assign.variable = new Value(new Literal(name), [new Access(base, 'proto')])
|
||||
if func instanceof Code and func.bound
|
||||
if func instanceof Code and func.bound and not assign.variable.this
|
||||
@boundFuncs.push base
|
||||
func.bound = no
|
||||
assign
|
||||
|
|
Loading…
Reference in a new issue