Sha256: 8c615ef4fd4f7033fb9d5e0ececbdfcec015e7f1df478917d58d0c56cf6b60b5

Contents?: true

Size: 1.19 KB

Versions: 62

Compression:

Stored size: 1.19 KB

Contents

// shim for using process in browser

var process = module.exports = {};
var queue = [];
var draining = false;

function drainQueue() {
    if (draining) {
        return;
    }
    draining = true;
    var currentQueue;
    var len = queue.length;
    while(len) {
        currentQueue = queue;
        queue = [];
        var i = -1;
        while (++i < len) {
            currentQueue[i]();
        }
        len = queue.length;
    }
    draining = false;
}
process.nextTick = function (fun) {
    queue.push(fun);
    if (!draining) {
        setTimeout(drainQueue, 0);
    }
};

process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues

function noop() {}

process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;

process.binding = function (name) {
    throw new Error('process.binding is not supported');
};

// TODO(shtylman)
process.cwd = function () { return '/' };
process.chdir = function (dir) {
    throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
smock-0.1.268 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.267 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.266 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.265 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.264 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.263 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.262 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.261 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.260 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.259 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.258 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.256 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.255 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.254 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.253 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.252 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.251 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.250 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.249 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js
smock-0.1.247 node_modules/webpack/node_modules/node-libs-browser/node_modules/timers-browserify/node_modules/process/browser.js