class.js
function() {
        if (!(this instanceof clazz)) {
          throw new Error("Use new keyword to create a new instance or call/apply class with right scope");
        }
        Class.onBeforeInstantiation && Class.onBeforeInstantiation(this);
        
        // remember the current super property
        var temp = this.__super__;
        // set the right super class prototype
        this.__super__ = superClass;

        // call the right constructor
        if (constructor) {
          constructor.apply(this, arguments);
        } else if (superClass) {
          superClass.apply(this, arguments);
        }
        // reset the current super property
        this.__super__ = temp;
        Class.onAfterInstantiation && Class.onAfterInstantiation(this);
      }
function() {
        if (!(this instanceof clazz)) {
          throw new Error("Use new keyword to create a new instance or call/apply class with right scope");
        }
        Class.onBeforeInstantiation && Class.onBeforeInstantiation(this);
        
        // remember the current super property
        var temp = this.__super__;
        // set the right super class prototype
        this.__super__ = superClass;

        // call the right constructor
        if (constructor) {
          constructor.apply(this, arguments);
        } else if (superClass) {
          superClass.apply(this, arguments);
        }
        // reset the current super property
        this.__super__ = temp;
        Class.onAfterInstantiation && Class.onAfterInstantiation(this);
      }
function ( ) { if ( ! ( this instanceof clazz ) ) { throw new Error ( "Use new keyword to create a new instance or call/apply class with right scope" ) ; } Class . onBeforeInstantiation && Class . onBeforeInstantiation ( this ) ; // remember the current super property var temp = this . __super__ ; // set the right super class prototype this . __super__ = superClass ; // call the right constructor if ( constructor ) { constructor . apply ( this , arguments ) ; } else if ( superClass ) { superClass . apply ( this , arguments ) ; } // reset the current super property this . __super__ = temp ; Class . onAfterInstantiation && Class . onAfterInstantiation ( this ) ; }
use clazz instead of class as it is a reserved keyword
use clazz instead of class as it is a reserved keyword