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 ); + } }); }