MCPcopy Create free account
hub / github.com/Yaffle/EventSource / supportsStreamOption

Function supportsStreamOption

tests/eventsource.js:180–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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()) {

Callers 1

eventsource.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected