我收到有关此代码的最大调用堆栈大小的错误。
function ValueObject() {
}
ValueObject.prototype.authentication;
Object.defineProperty(ValueObject.prototype, "authentication", {
get : function () {
return this.authentication;
},
set : function (val) {
this.authentication = val;
}
});
var vo = new ValueObject({last: "ac"});
vo.authentication = {a: "b"};
console.log(vo);
错误
RangeError: Maximum call stack size exceeded