From 68d03376f28e2449e380809a78b06c0bd7ce12c3 Mon Sep 17 00:00:00 2001 From: Adrian Lanning Date: Wed, 20 Jul 2011 19:05:00 -0400 Subject: [PATCH] Fix issue #1455 - Inherited Class generated code does not match order of execution --- lib/nodes.js | 2 +- src/nodes.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nodes.js b/lib/nodes.js index bbf3e84484..f5757ccc90 100644 --- a/lib/nodes.js +++ b/lib/nodes.js @@ -1117,10 +1117,10 @@ lname = new Literal(name); this.setContext(name); this.walkBody(name, o); - this.ensureConstructor(name); if (this.parent) { this.body.expressions.unshift(new Extends(lname, this.parent)); } + this.ensureConstructor(name); if (!(this.ctor instanceof Code)) { this.body.expressions.unshift(this.ctor); } diff --git a/src/nodes.coffee b/src/nodes.coffee index 0e448d3860..7a5dd476ac 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -896,8 +896,8 @@ exports.Class = class Class extends Base @setContext name @walkBody name, o - @ensureConstructor name @body.expressions.unshift new Extends lname, @parent if @parent + @ensureConstructor name @body.expressions.unshift @ctor unless @ctor instanceof Code @body.expressions.push lname @addBoundFunctions o