summaryrefslogtreecommitdiff
path: root/content/handlers/javascript/duktape/polyfill.js
diff options
context:
space:
mode:
Diffstat (limited to 'content/handlers/javascript/duktape/polyfill.js')
-rw-r--r--content/handlers/javascript/duktape/polyfill.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/content/handlers/javascript/duktape/polyfill.js b/content/handlers/javascript/duktape/polyfill.js
index 5f0215618..6c85ce1a0 100644
--- a/content/handlers/javascript/duktape/polyfill.js
+++ b/content/handlers/javascript/duktape/polyfill.js
@@ -83,3 +83,21 @@ if (!Array.from) {
};
}());
}
+
+// DOMTokenList formatter, in theory we can remove this if we do the stringifier IDL support
+
+DOMTokenList.prototype.toString = function () {
+ if (this.length == 0) {
+ return "";
+ }
+
+ var ret = this.item(0);
+ for (var index = 1; index < this.length; index++) {
+ ret = ret + " " + this.item(index);
+ }
+
+ return ret;
+}
+
+// Inherit the same toString for settable lists
+DOMSettableTokenList.prototype.toString = DOMTokenList.prototype.toString; \ No newline at end of file