From 984a14b087526b6f45e6dcb99bdf6b6808d284ef Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sun, 13 Mar 2011 14:51:40 -0400 Subject: [PATCH] Added more detailed documentation regarding the class_instance object --- lib/class.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/class.js b/lib/class.js index 3aae42e..a081056 100644 --- a/lib/class.js +++ b/lib/class.js @@ -39,10 +39,23 @@ var class_meta = {}; /** * Stores class instance visibility object * - * For each instance id, an object exists that contains the private and - * protected members. + * An entry in this table exists for each instance, with the instance id (iid) + * as the key. 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 protected members. * - * @type {Object.} + * Atop the base object is a private member object, with the base as its + * prototype. There exists a private member object for the instance itself and + * one for each supertype. This is stored by the class id (cid) as the key. This + * permits the private member object associated with the class of the method + * call to be bound to that method. For example, if a parent method is called, + * that call must be invoked in the context of the parent, so the private + * members of the parent must be made available. + * + * The resulting structure looks something like this: + * class_instance = { iid: { cid: {} } } + * + * @type {Object.>} */ var class_instance = {};