Sha256: 7b1aef69eaa9a0d221e05aaf240e1d46f777650ff2966d6fd5c483852b00172f

Contents?: true

Size: 1.4 KB

Versions: 8

Compression:

Stored size: 1.4 KB

Contents

var process = module.exports = {};

process.nextTick = (function () {
    var canSetImmediate = typeof window !== 'undefined'
        && window.setImmediate;
    var canPost = typeof window !== 'undefined'
        && window.postMessage && window.addEventListener
    ;

    if (canSetImmediate) {
        return function (f) { return window.setImmediate(f) };
    }

    if (canPost) {
        var queue = [];
        window.addEventListener('message', function (ev) {
            if (ev.source === window && ev.data === 'browserify-tick') {
                ev.stopPropagation();
                if (queue.length > 0) {
                    var fn = queue.shift();
                    fn();
                }
            }
        }, true);

        return function nextTick(fn) {
            queue.push(fn);
            window.postMessage('browserify-tick', '*');
        };
    }

    return function nextTick(fn) {
        setTimeout(fn, 0);
    };
})();

process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];

process.binding = function (name) {
    if (name === 'evals') return (require)('vm')
    else throw new Error('No such module. (Possibly not yet loaded)')
};

(function () {
    var cwd = '/';
    var path;
    process.cwd = function () { return cwd };
    process.chdir = function (dir) {
        if (!path) path = require('path');
        cwd = path.resolve(dir, cwd);
    };
})();

Version data entries

8 entries across 6 versions & 3 rubygems

Version Path
snowball-0.1.22 node_modules/browserify/builtins/__browserify_process.js
sprockets-browserify-0.2.0 node_modules/browserify/node_modules/browser-resolve/builtin/process.js
ruby-wisp-source-0.8.0 vendor/node_modules/browserify/node_modules/browser-resolve/builtin/process.js
ruby-wisp-source-0.7.0 vendor/node_modules/browserify/node_modules/browser-resolve/builtin/process.js
sprockets-browserify-0.1.2 node_modules/browserify/builtins/__browserify_process.js
sprockets-browserify-0.1.2 node_modules/module-deps/node_modules/browser-resolve/builtin/process.js
sprockets-browserify-0.1.0 node_modules/module-deps/node_modules/browser-resolve/builtin/process.js
sprockets-browserify-0.1.0 node_modules/browserify/builtins/__browserify_process.js