Skip to content

Commit

Permalink
Do inheritance a bit more correctly
Browse files Browse the repository at this point in the history
Closes #27.
  • Loading branch information
domenic committed Apr 29, 2017
1 parent 989a906 commit c2214f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/constructs/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ Interface.prototype.generateConstructor = function () {
}

if (this.idl.inheritance) {
this.str += `${this.name}.prototype = Object.create(${this.idl.inheritance}.interface.prototype);
${this.name}.prototype.constructor = ${this.name};\n`;
this.str += `Object.setPrototypeOf(${this.name}.prototype, ${this.idl.inheritance}.interface.prototype);
Object.setPrototypeOf(${this.name}, ${this.idl.inheritance}.name);\n`;
}
};

Expand Down

0 comments on commit c2214f1

Please sign in to comment.