setimmediate
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"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)); |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
8077
3
147
1
0