mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-03 12:23:51 +00:00
Added some judicious hasOwnProperty() checks
This commit is contained in:
parent
f29f06f3e9
commit
d399a01f15
@ -72,7 +72,7 @@ var ArgParser = function(argString,options) {
|
|||||||
}
|
}
|
||||||
if(n.evaluated === true) {
|
if(n.evaluated === true) {
|
||||||
n = "{{" + n.string + "}}";
|
n = "{{" + n.string + "}}";
|
||||||
} else if (typeof n === "object" && "string" in n) {
|
} else if (typeof n === "object" && n.hasOwnProperty("string")) {
|
||||||
n = n.string;
|
n = n.string;
|
||||||
}
|
}
|
||||||
this.byPos.push({n:n, v:v});
|
this.byPos.push({n:n, v:v});
|
||||||
@ -87,7 +87,7 @@ var ArgParser = function(argString,options) {
|
|||||||
for(var t=0; t<this.byPos.length; t++) {
|
for(var t=0; t<this.byPos.length; t++) {
|
||||||
n = this.byPos[t].n;
|
n = this.byPos[t].n;
|
||||||
v = this.byPos[t].v;
|
v = this.byPos[t].v;
|
||||||
if(n in this.byName)
|
if(this.byName.hasOwnProperty("n"))
|
||||||
this.byName[n].push(v);
|
this.byName[n].push(v);
|
||||||
else
|
else
|
||||||
this.byName[n] = [v];
|
this.byName[n] = [v];
|
||||||
|
@ -23,7 +23,9 @@ utils.deepCopy = function(v) {
|
|||||||
} else if (typeof v === "object" && v) {
|
} else if (typeof v === "object" && v) {
|
||||||
r = {};
|
r = {};
|
||||||
for(t in v) {
|
for(t in v) {
|
||||||
r[t] = utils.deepCopy(v[t]);
|
if(v.hasOwnPropery(t)) {
|
||||||
|
r[t] = utils.deepCopy(v[t]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
r = v;
|
r = v;
|
||||||
|
@ -273,7 +273,7 @@ WikiStore.prototype.getCacheForTiddler = function(title,cacheName,initializer) {
|
|||||||
|
|
||||||
// Clear all caches associated with a particular tiddler
|
// Clear all caches associated with a particular tiddler
|
||||||
WikiStore.prototype.clearCache = function(title) {
|
WikiStore.prototype.clearCache = function(title) {
|
||||||
if(title in this.caches) {
|
if(this.caches.hasOwnProperty("title")) {
|
||||||
delete this.caches[title];
|
delete this.caches[title];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user