diff --git a/lib/class_builder.js b/lib/class_builder.js index e1757f2..fc8f7c8 100644 --- a/lib/class_builder.js +++ b/lib/class_builder.js @@ -322,9 +322,9 @@ function createConcreteCtor( cname, members ) } // generate and store unique instance id - attachInstanceId( this, ++instance_id, ClassInstance ); + attachInstanceId( this, ++instance_id ); - initInstance( instance_id, this ); + initInstance( this ); this.__initProps(); // If we're extending, we don't actually want to invoke any class @@ -771,10 +771,10 @@ function attachInstanceId( instance, iid ) /** * Initializes class instance * - * This process will create the instance visibility object containing private - * and protected members. The class instance is part of the prototype chain. - * This will be passed to all methods when invoked, permitting them to access - * the private and protected members while keeping them encapsulated. + * This process will create the instance visibility object that will contain + * private and protected members. The class instance is part of the prototype + * chain. This will be passed to all methods when invoked, permitting them to + * access the private and protected members while keeping them encapsulated. * * For each instance, there is always a base. The base will contain a proxy to * the public members on the instance itself. The base will also contain all @@ -791,12 +791,11 @@ function attachInstanceId( instance, iid ) * The resulting structure looks something like this: * class_instance = { iid: { cid: {} } } * - * @param {number} iid instance id * @param {Object} instance instance to initialize * * @return {undefined} */ -function initInstance( iid, instance ) +function initInstance( instance ) { var prot = function() {}; prot.prototype = instance;