diff options
Diffstat (limited to 'content/handlers/javascript/duktape/polyfill.js')
-rw-r--r-- | content/handlers/javascript/duktape/polyfill.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/content/handlers/javascript/duktape/polyfill.js b/content/handlers/javascript/duktape/polyfill.js index 7fa46111f..6c85ce1a0 100644 --- a/content/handlers/javascript/duktape/polyfill.js +++ b/content/handlers/javascript/duktape/polyfill.js @@ -1,6 +1,6 @@ /* Polyfiller for Duktape for NetSurf * - * This JavaScript will be loaded into compartments before the generics + * This JavaScript will be loaded into heaps before the generics * * We only care for the side-effects of this, be careful. */ @@ -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 |