From 170eb06af674d5b3d45f50df4d47d3bf2e9aab10 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Wed, 30 Mar 2011 23:31:46 -0400 Subject: [PATCH] Only adding __self() for instance, not supertype init --- lib/class_builder.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/class_builder.js b/lib/class_builder.js index 2ca33d0..89948eb 100644 --- a/lib/class_builder.js +++ b/lib/class_builder.js @@ -522,8 +522,12 @@ function attachPropInit( prototype, properties, members, cid ) // provide a means to access the actual instance (rather than the // property/visibility object) internally (this will translate to - // this.__self from within a method) - util.defineSecureProp( vis, '__self', this ); + // this.__self from within a method), but only if we're on our final + // object (not a parent) + if ( typeof parent_init !== 'function' ) + { + util.defineSecureProp( vis, '__self', this ); + } }); }