public

  • Download Gist
cant set _properties in setter.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
resourceful=require('./');
X=resourceful.define({
name:'XXX',
properties:{
z:{
type:'number',
get:function(val){
console.log('get','this',this,'val',val);
return this._properties.z;
},
set:function(val){
console.error('set','this',this,'val',val);
this._properties.z = 2;
}
}
}
});
a=new X({z:1})
console.error(a)
a._properties.z = 1;
console.error(a)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.