{“ast”:null,“code”:“(function (global, undefined) {n "use strict";nn if (global.setImmediate) {n return;n }nn var nextHandle = 1; // Spec says greater than zeronn var tasksByHandle = {};n var currentlyRunningATask = false;n var doc = global.document;n var registerImmediate;nn function setImmediate(callback) {n // Callback can either be a function or a stringn if (typeof callback !== "function") {n callback = new Function("" + callback);n } // Copy function argumentsnnn var args = new Array(arguments.length - 1);nn for (var i = 0; i < args.length; i++) {n args = arguments[i + 1];n } // Store and register the tasknnn var task = {n callback: callback,n args: argsn };n tasksByHandle = task;n registerImmediate(nextHandle);n return nextHandle++;n }nn function clearImmediate(handle) {n delete tasksByHandle;n }nn function run(task) {n var callback = task.callback;n var args = task.args;nn switch (args.length) {n case 0:n callback();n break;nn case 1:n callback(args);n break;nn case 2:n callback(args, args);n break;nn case 3:n callback(args, args, args);n break;nn default:n callback.apply(undefined, args);n break;n }n }nn function runIfPresent(handle) {n // From the spec: "Wait until any invocations of this algorithm started before this one have completed."n // So if we're currently running a task, we'll need to delay this invocation.n if (currentlyRunningATask) {n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated an // "too much recursion" error.n setTimeout(runIfPresent, 0, handle);n } else {n var task = tasksByHandle;nn if (task) {n currentlyRunningATask = true;nn try {n run(task);n } finally {n clearImmediate(handle);n currentlyRunningATask = false;n }n }n }n }nn function installNextTickImplementation() {n registerImmediate = function registerImmediate(handle) {n process.nextTick(function () {n runIfPresent(handle);n });n };n }nn function canUsePostMessage() {n // The test against `importScripts` prevents this implementation from being installed inside a web worker,n // where `global.postMessage` means something completely different and can't be used for this purpose.n if (global.postMessage && !global.importScripts) {n var postMessageIsAsynchronous = true;n var oldOnMessage = global.onmessage;nn global.onmessage = function () {n postMessageIsAsynchronous = false;n };nn global.postMessage("", "*");n global.onmessage = oldOnMessage;n return postMessageIsAsynchronous;n }n }nn function installPostMessageImplementation() {n // Installs an event handler on `global` for the `message` event: seen // * developer.mozilla.org/en/DOM/window.postMessagen // * www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessagesn var messagePrefix = "setImmediate$" + Math.random() + "$";nn var onGlobalMessage = function onGlobalMessage(event) {n if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) {n runIfPresent(+event.data.slice(messagePrefix.length));n }n };nn if (global.addEventListener) {n global.addEventListener("message", onGlobalMessage, false);n } else {n global.attachEvent("onmessage", onGlobalMessage);n }nn registerImmediate = function registerImmediate(handle) {n global.postMessage(messagePrefix + handle, "*");n };n }nn function installMessageChannelImplementation() {n var channel = new MessageChannel();nn channel.port1.onmessage = function (event) {n var handle = event.data;n runIfPresent(handle);n };nn registerImmediate = function registerImmediate(handle) {n channel.port2.postMessage(handle);n };n }nn function installReadyStateChangeImplementation() {n var html = doc.documentElement;nn registerImmediate = function registerImmediate(handle) {n // Create a <script> element; its readystatechange event will be fired asynchronously once it is insertedn // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.n var script = doc.createElement("script");nn script.onreadystatechange = function () {n runIfPresent(handle);n script.onreadystatechange = null;n html.removeChild(script);n script = null;n };nn html.appendChild(script);n };n }nn function installSetTimeoutImplementation() {n registerImmediate = function registerImmediate(handle) {n setTimeout(runIfPresent, 0, handle);n };n } // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.nnn var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);n attachTo = attachTo && attachTo.setTimeout ? attachTo : global; // Don't get fooled by e.g. browserify environments.nn if ({}.toString.call(global.process) === "[object process]") {n // For Node.js before 0.9n installNextTickImplementation();n } else if (canUsePostMessage()) {n // For non-IE10 modern browsersn installPostMessageImplementation();n } else if (global.MessageChannel) {n // For web workers, where supportedn installMessageChannelImplementation();n } else if (doc && "onreadystatechange" in doc.createElement("script")) {n // For IE 6–8n installReadyStateChangeImplementation();n } else {n // For older browsersn installSetTimeoutImplementation();n }nn attachTo.setImmediate = setImmediate;n attachTo.clearImmediate = clearImmediate;n})(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self);”,“map”:null,“metadata”:{},“sourceType”:“module”}