Cosmetic bug fixes.

This commit is contained in:
hackademix 2018-07-16 15:55:01 +02:00
parent f6b7232857
commit ad6187dfd8
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
'use strict';
{
let NULL = new Uint8Array();
let DEFAULT_CHARSET = "utf-8";
let xmlFeedOrImage = /^(?:(?:application|text)\/(?:(?:r(?:ss|df)|atom)\+)xml(;|$))|image\//i;
let rawXml = /^(?:application|text)\/xml;/i;
let brokenOnLoad;

View File

@ -17,12 +17,13 @@ class ContentMetaData {
charset = m[1];
}
}
Object.defineProperty(this, "charset", { value: charset, writable: false, configurable: true })
Object.defineProperty(this, "charset", { value: charset, writable: false, configurable: true });
return charset;
}
createDecoder() {
try {
return new TextDecoder(charset);
return new TextDecoder(this.charset);
} catch (e) {
return new TextDecoder(this.defaultCharset);
}