Merge pull request #222 from aurimasv/deepCopy
[Utilities] Deep copy `null` as `null`. Display object type in varDump
This commit is contained in:
commit
620b8abb2c
1 changed files with 2 additions and 2 deletions
|
@ -914,7 +914,7 @@ Zotero.Utilities = {
|
||||||
for(var i in obj) {
|
for(var i in obj) {
|
||||||
if(!obj.hasOwnProperty(i)) continue;
|
if(!obj.hasOwnProperty(i)) continue;
|
||||||
|
|
||||||
if(typeof obj[i] === "object") {
|
if(typeof obj[i] === "object" && obj[i] !== null) {
|
||||||
obj2[i] = Zotero.Utilities.deepCopy(obj[i]);
|
obj2[i] = Zotero.Utilities.deepCopy(obj[i]);
|
||||||
} else {
|
} else {
|
||||||
obj2[i] = obj[i];
|
obj2[i] = obj[i];
|
||||||
|
@ -1139,7 +1139,7 @@ Zotero.Utilities = {
|
||||||
closeBrace = ']';
|
closeBrace = ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
dumped_text += level_padding + "'" + item + "' => " + openBrace;
|
dumped_text += level_padding + "'" + item + "' => " + type + ' ' + openBrace;
|
||||||
//only recurse if there's anything in the object, purely cosmetical
|
//only recurse if there's anything in the object, purely cosmetical
|
||||||
try {
|
try {
|
||||||
for(var i in value) {
|
for(var i in value) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue