diff --git a/lib/class_builder.js b/lib/class_builder.js index a75863f..9da84e0 100644 --- a/lib/class_builder.js +++ b/lib/class_builder.js @@ -525,11 +525,11 @@ 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), but only if we're on our final + // this.__inst 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 ); + util.defineSecureProp( vis, '__inst', this ); } }); } diff --git a/test/test-class_builder-visibility.js b/test/test-class_builder-visibility.js index ce83751..98861c6 100644 --- a/test/test-class_builder-visibility.js +++ b/test/test-class_builder-visibility.js @@ -38,7 +38,7 @@ var common = require( './common' ), * Unfortunately, there's really no way around that. Maybe a more elegant * solution will arise in the future. For now, not likely. * - * We need to provide a means to reference the actual instance. __self is that + * We need to provide a means to reference the actual instance. __inst is that * solution. */ ( function testSelfPropertyReferencesInstanceRatherThanPropObj() @@ -51,22 +51,22 @@ var common = require( './common' ), { // rather than returning, assign to external var so that we can // rest assured that the return value wasn't manipulated - result = this.__self; + result = this.__inst; ref = this; } } )(); assert.deepEqual( result, foo, - "this.__self returns reference to actual instance" + "this.__inst returns reference to actual instance" ); // the property should be read-only if ( util.definePropertyFallback() === false ) { assert.equal( - Object.getOwnPropertyDescriptor( ref, '__self' ).writable, + Object.getOwnPropertyDescriptor( ref, '__inst' ).writable, false, - "this.__self is not writable" + "this.__inst is not writable" ); } } )();