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