// 實現克隆Clone
// let obj = new window[this._type];
// let obj = DObject.deepCopy(this);
// let obj = this.constructor();
let obj = Class.createObject(this._type, false);
1. new window[type]
要確保type 就是類名,否則出錯。
2. DObject.deepCopy(this);
深拷貝自己實現.
3. this.constructor();
因爲是this 調用constructor(),可能會修改this 本身,導致錯誤.
4. createObject 利用工廠模式克隆構造對象;
除了深拷貝外,其他方法都要進行 assign 賦值,賦值要注意值引用.