mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Make fakedom more resilient to non-string data
This commit is contained in:
parent
0f85ca3478
commit
c8f7573a23
@ -23,7 +23,7 @@ var bumpSequenceNumber = function(object) {
|
||||
|
||||
var TW_TextNode = function(text) {
|
||||
bumpSequenceNumber(this);
|
||||
this.textContent = text;
|
||||
this.textContent = text + "";
|
||||
};
|
||||
|
||||
Object.defineProperty(TW_TextNode.prototype, "nodeType", {
|
||||
@ -66,7 +66,7 @@ TW_Element.prototype.setAttribute = function(name,value) {
|
||||
if(this.isRaw) {
|
||||
throw "Cannot setAttribute on a raw TW_Element";
|
||||
}
|
||||
this.attributes[name] = value;
|
||||
this.attributes[name] = value + "";
|
||||
};
|
||||
|
||||
TW_Element.prototype.setAttributeNS = function(namespace,name,value) {
|
||||
@ -139,7 +139,7 @@ Object.defineProperty(TW_Element.prototype, "className", {
|
||||
return this.attributes["class"] || "";
|
||||
},
|
||||
set: function(value) {
|
||||
this.attributes["class"] = value;
|
||||
this.attributes["class"] = value + "";
|
||||
}
|
||||
});
|
||||
|
||||
@ -148,7 +148,7 @@ Object.defineProperty(TW_Element.prototype, "value", {
|
||||
return this.attributes.value || "";
|
||||
},
|
||||
set: function(value) {
|
||||
this.attributes.value = value;
|
||||
this.attributes.value = value + "";
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user