use transform insted treewalker
This commit is contained in:
parent
363019dc5a
commit
ba3a59843a
14
lib/utils.js
14
lib/utils.js
|
|
@ -300,17 +300,3 @@ Dictionary.prototype = {
|
||||||
return ret;
|
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