MCPcopy
hub / github.com/socketio/socket.io / installTimerFunctions

Function installTimerFunctions

packages/socket.io/client-dist/socket.io.js:699–707  ·  view source on GitHub ↗
(obj, opts)

Source from the content-addressed store, hash-verified

697 var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout;
698 var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
699 function installTimerFunctions(obj, opts) {
700 if (opts.useNativeTimers) {
701 obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
702 obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
703 } else {
704 obj.setTimeoutFn = globalThisShim.setTimeout.bind(globalThisShim);
705 obj.clearTimeoutFn = globalThisShim.clearTimeout.bind(globalThisShim);
706 }
707 }
708 // base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)
709 var BASE64_OVERHEAD = 1.33;
710 // we could also have used `new Blob([obj]).size`, but it isn't supported in IE9

Callers 7

constructorMethod · 0.90
constructorFunction · 0.90
constructorMethod · 0.90
TransportFunction · 0.70
RequestFunction · 0.70
SocketWithoutUpgradeFunction · 0.70
ManagerFunction · 0.70

Calls 1

bindMethod · 0.80

Tested by

no test coverage detected