mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-22 22:10:03 +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) {
|
||||
n = "{{" + n.string + "}}";
|
||||
} else if (typeof n === "object" && "string" in n) {
|
||||
} else if (typeof n === "object" && n.hasOwnProperty("string")) {
|
||||
n = n.string;
|
||||
}
|
||||
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++) {
|
||||
n = this.byPos[t].n;
|
||||
v = this.byPos[t].v;
|
||||
if(n in this.byName)
|
||||
if(this.byName.hasOwnProperty("n"))
|
||||
this.byName[n].push(v);
|
||||
else
|
||||
this.byName[n] = [v];
|
||||
|
@ -23,7 +23,9 @@ utils.deepCopy = function(v) {
|
||||
} else if (typeof v === "object" && v) {
|
||||
r = {};
|
||||
for(t in v) {
|
||||
r[t] = utils.deepCopy(v[t]);
|
||||
if(v.hasOwnPropery(t)) {
|
||||
r[t] = utils.deepCopy(v[t]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
r = v;
|
||||
|
@ -273,7 +273,7 @@ WikiStore.prototype.getCacheForTiddler = function(title,cacheName,initializer) {
|
||||
|
||||
// Clear all caches associated with a particular tiddler
|
||||
WikiStore.prototype.clearCache = function(title) {
|
||||
if(title in this.caches) {
|
||||
if(this.caches.hasOwnProperty("title")) {
|
||||
delete this.caches[title];
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user