我有这样的代码;
function A(){}
Object.defineProperties(A.prototype,{
'propName' : {
'get' : function(){
return 'hallo';
},
'set' : function( p ){
console.log( 'setting...' );
}
}
});
function B(){
A.call( this )
}
B.prototype = Object.create( new A(), {
'propName' : {
'get' : function(){
//do something than call getter of parent prototype
},
'set' : function( p ){
//do something than call setter of parent prototype
},
}
});
是否可以调用 getter 或 setter 的原型,如果可以,如何调用?
问候……