use transform insted treewalker
This commit is contained in:
parent
363019dc5a
commit
ba3a59843a
16
lib/utils.js
16
lib/utils.js
|
|
@ -299,18 +299,4 @@ Dictionary.prototype = {
|
|||
ret.push(f(this._values[i], i.substr(1)));
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
function CopyObject(obj){
|
||||
var newObj = {};
|
||||
for(var i in obj) if(obj.hasOwnProperty(i)) newObj[i] = obj[i];
|
||||
newObj.__proto__ = obj.__proto__;
|
||||
return newObj
|
||||
}
|
||||
|
||||
function ReplaceObject(obj, newObj){
|
||||
for(var i in obj) if(obj.hasOwnProperty(i)) delete obj[i];
|
||||
for(var i in newObj) if(newObj.hasOwnProperty(i)) obj[i] = newObj[i];
|
||||
obj.__proto__ = newObj.__proto__;
|
||||
return obj;
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user