js.private
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -29,3 +29,4 @@ "use strict"; | ||
value: function get(context) { | ||
return context[this.key] || this.set(context); | ||
if (!context[this.key]) this.set(context); | ||
return context[this.key]; | ||
} | ||
@@ -38,3 +39,3 @@ }, { | ||
if (clone.hasOwnProperty(attr) && clone[attr] instanceof Function) clone[attr] = this.bind(clone[attr], context); | ||
}return context.__defineGetter__(this.key, function () { | ||
}context.__defineGetter__(this.key, function () { | ||
return clone; | ||
@@ -41,0 +42,0 @@ }); |
{ | ||
"name": "js.private", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Private properties for objects", | ||
@@ -5,0 +5,0 @@ "main": "./dst/Private.js", |
@@ -13,3 +13,4 @@ import Clone from "js.clone"; | ||
get( context ){ | ||
return context[ this.key ] || this.set( context ); | ||
if( !context[ this.key ] ) this.set( context ); | ||
return context[ this.key ]; | ||
} | ||
@@ -22,3 +23,3 @@ | ||
clone[ attr ] = this.bind( clone[ attr ], context ); | ||
return context.__defineGetter__( this.key, function(){ return clone; } ); | ||
context.__defineGetter__( this.key, function(){ return clone; } ); | ||
} | ||
@@ -25,0 +26,0 @@ |
4346
80