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) { ...@@ -258,11 +258,7 @@ var command = function(spec, my) {
* @return {object} The clone of the command options. * @return {object} The clone of the command options.
*/ */
that.cloneOption = function () { that.cloneOption = function () {
var k, o = {}; return JSON.parse(JSON.stringify(priv.option));
for (k in priv.option) {
o[k] = priv.option[k];
}
return o;
}; };
/** /**
...@@ -271,14 +267,7 @@ var command = function(spec, my) { ...@@ -271,14 +267,7 @@ var command = function(spec, my) {
* @return {object} The clone of the document. * @return {object} The clone of the document.
*/ */
that.cloneDoc = function () { that.cloneDoc = function () {
if (priv.docid) { return JSON.parse(JSON.stringify(priv.doc));
return priv.docid;
}
var k, o = {};
for (k in priv.doc) {
o[k] = priv.doc[k];
}
return o;
}; };
return that; 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