Commit 192c14a1 authored by Tristan Cavelier's avatar Tristan Cavelier

clone object method redesigned on command.js

parent 63ab5185
......@@ -258,11 +258,7 @@ var command = function(spec, my) {
* @return {object} The clone of the command options.
*/
that.cloneOption = function () {
var k, o = {};
for (k in priv.option) {
o[k] = priv.option[k];
}
return o;
return JSON.parse(JSON.stringify(priv.option));
};
/**
......@@ -271,14 +267,7 @@ var command = function(spec, my) {
* @return {object} The clone of the document.
*/
that.cloneDoc = function () {
if (priv.docid) {
return priv.docid;
}
var k, o = {};
for (k in priv.doc) {
o[k] = priv.doc[k];
}
return o;
return JSON.parse(JSON.stringify(priv.doc));
};
return that;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment