()
| 178 | |
| 179 | // Firefox < 38 throws an error with stream option |
| 180 | var supportsStreamOption = function () { |
| 181 | try { |
| 182 | return new TextDecoder().decode(new TextEncoder().encode("test"), {stream: true}) === "test"; |
| 183 | } catch (error) { |
| 184 | console.debug("TextDecoder does not support streaming option. Using polyfill instead: " + error); |
| 185 | } |
| 186 | return false; |
| 187 | }; |
| 188 | |
| 189 | // IE, Edge |
| 190 | if (TextDecoder == undefined || TextEncoder == undefined || !supportsStreamOption()) { |