MCPcopy Index your code
hub / github.com/socketio/socket.io / installTimerFunctions

Function installTimerFunctions

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

Source from the content-addressed store, hash-verified

771 var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout;
772 var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
773 function installTimerFunctions(obj, opts) {
774 if (opts.useNativeTimers) {
775 obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
776 obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
777 } else {
778 obj.setTimeoutFn = globalThisShim.setTimeout.bind(globalThisShim);
779 obj.clearTimeoutFn = globalThisShim.clearTimeout.bind(globalThisShim);
780 }
781 }
782 // base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)
783 var BASE64_OVERHEAD = 1.33;
784 // we could also have used `new Blob([obj]).size`, but it isn't supported in IE9

Callers 4

TransportFunction · 0.85
RequestFunction · 0.85
SocketFunction · 0.85
ManagerFunction · 0.85

Calls 1

bindMethod · 0.80

Tested by

no test coverage detected