87,993
社区成员
发帖
与我相关
我的任务
分享

function a()
{
var v1=0;
Object.defineProperty(this,"v1",{
set: function(v){
b(v);
v1 = v;
},
get: function(){
return v1;
}
})
this.v2="hello";
function b(v)
{
console.log("b函数调用了",v);
}
}
var xx = new a();
xx.v1 = 8;