mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-31 07:32:59 +00:00 
			
		
		
		
	Added some judicious hasOwnProperty() checks
This commit is contained in:
		| @@ -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,8 +23,10 @@ utils.deepCopy = function(v) { | ||||
| 	} else if (typeof v === "object" && v) { | ||||
| 		r = {}; | ||||
| 		for(t in v) { | ||||
| 			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]; | ||||
| 	} | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jeremy Ruston
					Jeremy Ruston