1
0
Fork 0
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:
Gerald Lewis 2011-08-04 13:39:07 -04:00
parent 9f89a83c27
commit 638dbbecbc
2 changed files with 2 additions and 2 deletions

View file

@ -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;
}

View file

@ -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