     @setContext name
     @walkBody name
     @ensureConstructor name
-    @body.expressions.splice 1, 0, new Extends(lname, @parent) if @parent
+    @body.expressions.unshift @ctor unless @ctor instanceof Code
+    if @parent
+      extension = new Extends lname, @parent
+      if @ctor instanceof Code
+        @body.expressions.unshift extension
+      else
+        @body.expressions.splice 1, 0, extension
     @body.expressions.push lname
     @addBoundFunctions o
 

            @boundFuncs.push base
            func.bound = no
      assign

  # Walk the body of the class, looking for prototype properties to be converted.
  walkBody: (name) ->

          if func instanceof Code
            assign = @ctor = func
          else
            assign = null
            @ctor = new Assign new Value(new Literal name), func
        else
          unless assign.variable.this
            assign.variable = new Value(new Literal(name), [new Access(base, 'proto')])
