我有以下功能,我正在尝试在 Photoshop 中实现(使用 Javascript ES3 编写脚本)。我怎么能把它写成与 ES3 兼容?
function VParabola(s){
this.cEvent = null;
this.parent = null;
this._left = null;
this._right = null;
this.site = s;
this.isLeaf = (this.site != null);
}
VParabola.prototype = {
get left(){
return this._left;
},
get right(){
return this._right;
},
set left(p){
this._left = p;
p.parent = this;
},
set right(p){
this._right = p;
p.parent = this;
}
};