[提问]: 重载cc.Node属性的get/set出错

let temp1_o = {};
Object.defineProperty(cc.Node.prototype, "xxx", {
    get: function () {
        return temp1_o;
    },
    set: function (new_a: any) {
        temp1_o = new_a;
    },
});

编辑器报错

TypeError: Cannot redefine property: xxx

执行语句直接跳转到这儿来了

怎么解决

原来还需要加属性configurable: true才可以,解决了