diff --git a/lib/nodes.js b/lib/nodes.js index ecd2c718..c82f3035 100644 --- a/lib/nodes.js +++ b/lib/nodes.js @@ -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; } diff --git a/src/nodes.coffee b/src/nodes.coffee index c40890ad..58c800d7 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -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