kriskowal / q

A promise library for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid token q.js?v=1588706333081:854 Invalid token

fpedroza opened this issue · comments

I'm running into an error and I'm not sure what's causing it. The call is resulting in an "Invalid token" console message coming from line 854 from q.js. I'm running q@1.5.1. The value of value in the following code appears to be "Invalid token". I'm at a loss as to how to debug this issue. Any thoughts would be appreciated.

Promise.prototype.then = function (fulfilled, rejected, progressed) {
    var self = this;
    var deferred = defer();
    var done = false;   // ensure the untrusted promise makes at most a
                        // single call to one of the callbacks

    function _fulfilled(value) {
        try {
            return typeof fulfilled === "function" ? fulfilled(value) : value;
        } catch (exception) {
            return reject(exception);
        }
    }
  • q doesn't log anything to console, so it's likely an uncaught exception? You'll have to paste the entire stack to know.
  • You might be better off switching your code to Promise, which has native support and therefore better error management.