PHP 8.2.30
Preview: context.js Size: 2.33 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/bluebird/js/release/context.js

"use strict";
module.exports = function(Promise) {
var longStackTraces = false;
var contextStack = [];

Promise.prototype._promiseCreated = function() {};
Promise.prototype._pushContext = function() {};
Promise.prototype._popContext = function() {return null;};
Promise._peekContext = Promise.prototype._peekContext = function() {};

function Context() {
    this._trace = new Context.CapturedTrace(peekContext());
}
Context.prototype._pushContext = function () {
    if (this._trace !== undefined) {
        this._trace._promiseCreated = null;
        contextStack.push(this._trace);
    }
};

Context.prototype._popContext = function () {
    if (this._trace !== undefined) {
        var trace = contextStack.pop();
        var ret = trace._promiseCreated;
        trace._promiseCreated = null;
        return ret;
    }
    return null;
};

function createContext() {
    if (longStackTraces) return new Context();
}

function peekContext() {
    var lastIndex = contextStack.length - 1;
    if (lastIndex >= 0) {
        return contextStack[lastIndex];
    }
    return undefined;
}
Context.CapturedTrace = null;
Context.create = createContext;
Context.deactivateLongStackTraces = function() {};
Context.activateLongStackTraces = function() {
    var Promise_pushContext = Promise.prototype._pushContext;
    var Promise_popContext = Promise.prototype._popContext;
    var Promise_PeekContext = Promise._peekContext;
    var Promise_peekContext = Promise.prototype._peekContext;
    var Promise_promiseCreated = Promise.prototype._promiseCreated;
    Context.deactivateLongStackTraces = function() {
        Promise.prototype._pushContext = Promise_pushContext;
        Promise.prototype._popContext = Promise_popContext;
        Promise._peekContext = Promise_PeekContext;
        Promise.prototype._peekContext = Promise_peekContext;
        Promise.prototype._promiseCreated = Promise_promiseCreated;
        longStackTraces = false;
    };
    longStackTraces = true;
    Promise.prototype._pushContext = Context.prototype._pushContext;
    Promise.prototype._popContext = Context.prototype._popContext;
    Promise._peekContext = Promise.prototype._peekContext = peekContext;
    Promise.prototype._promiseCreated = function() {
        var ctx = this._peekContext();
        if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;
    };
};
return Context;
};

Directory Contents

Dirs: 0 × Files: 37

Name Size Perms Modified Actions
421 B lrw-r--r-- 2026-02-21 00:53:44
Edit Download
1.61 KB lrw-r--r-- 2026-02-21 00:53:44
Edit Download
2.81 KB lrw-r--r-- 2026-02-21 00:53:46
Edit Download
1.92 KB lrw-r--r-- 2026-02-21 00:53:46
Edit Download
291 B lrw-r--r-- 2026-02-21 00:53:48
Edit Download
4.25 KB lrw-r--r-- 2026-02-21 00:53:50
Edit Download
3.62 KB lrw-r--r-- 2026-02-21 00:53:50
Edit Download
1.39 KB lrw-r--r-- 2026-02-21 00:53:50
Edit Download
2.33 KB lrw-r--r-- 2026-02-21 00:53:50
Edit Download
31.42 KB lrw-r--r-- 2026-02-21 00:53:52
Edit Download
1.36 KB lrw-r--r-- 2026-02-21 00:53:54
Edit Download
789 B lrw-r--r-- 2026-02-21 00:53:54
Edit Download
3.63 KB lrw-r--r-- 2026-02-21 00:53:56
Edit Download
1.93 KB lrw-r--r-- 2026-02-21 00:53:56
Edit Download
314 B lrw-r--r-- 2026-02-21 00:53:56
Edit Download
4.50 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
7.58 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
7.95 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
5.47 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
1.73 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
1.52 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
1.61 KB lrw-r--r-- 2026-02-21 00:53:58
Edit Download
26.35 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
5.13 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
11.90 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
3.04 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
1.83 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
1.22 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
5.25 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
2.10 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
1.33 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
3.87 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
2.75 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
2.08 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
2.34 KB lrw-r--r-- 2026-02-21 00:54:02
Edit Download
7.35 KB lrw-r--r-- 2026-02-21 00:54:02
Edit Download
11.11 KB lrw-r--r-- 2026-02-21 00:54:02
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).