Socket
Socket
Sign inDemoInstall

setimmediate

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

7

package.json
{
"name": "setimmediate",
"description": "A shim for the setImmediate efficient script yielding API",
"version": "1.0.2",
"version": "1.0.3",
"author": "YuzuJS",
"contributors": [
"Domenic Denicola <domenic@domenicdenicola.com> (http://domenic.me)",
"Domenic Denicola <d@domenic.me> (https://domenic.me)",
"Donavon West <github@donavon.com> (http://donavon.com)",

@@ -12,4 +12,3 @@ "Yaffle"

"license": "MIT",
"repository": "git://github.com/YuzuJS/setImmediate.git",
"bugs": "https://github.com/YuzuJS/setImmediate/issues",
"repository": "YuzuJS/setImmediate",
"main": "setImmediate.js",

@@ -16,0 +15,0 @@ "scripts": {

@@ -121,16 +121,14 @@ (function (global, undefined) {

function installReadyStateChangeImplementation() {
var html = doc.documentElement;
function installImageImplementation() {
setImmediate = function() {
var handle = addFromSetImmediateArguments(arguments);
// Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
// into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
var script = doc.createElement("script");
script.onreadystatechange = function () {
var image = new global.Image();
image.onerror = function() {
runIfPresent(handle);
script.onreadystatechange = null;
html.removeChild(script);
script = null;
};
html.appendChild(script);
// This will always cause an error event to fire.
image.src = "\0";
return handle;

@@ -165,8 +163,8 @@ };

} else if (doc && "onreadystatechange" in doc.createElement("script")) {
// For IE 6–8
installReadyStateChangeImplementation();
} else if (doc && global.Image) {
// For IE 6–8, maybe older browsers
installImageImplementation();
} else {
// For older browsers
// Ultimate fallback
installSetTimeoutImplementation();

@@ -177,2 +175,2 @@ }

attachTo.clearImmediate = clearImmediate;
}(new Function("return this")()));
}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc