Skip to content

Firefox: calling resolve() don't resolve then() #1022

@toverux

Description

@toverux

I'm using BlueBird version 3.3.3.
Platform: Ubuntu with Firefox 45 / Chromium 48

When I call resolve(), the promise listener registered with .then() is never called on Firefox, but it is on Chromium.

Relevant code :

// Used to suppress the click event when the promise is resolved().
const makeSilent = (resolve) => {
    return () => resolve(); // This is called, after that I don't know what happens
};

Dialog = class Dialog {
    static confirm(opts) {
        return new Promise((resolve) => {
            let $confirm = findDialog('confirm');
            refreshDialog($confirm, opts);

            // We call resolve when the 'OK' button is clicked.
            getOk($confirm).click(makeSilent(resolve));

            showDialog($confirm);
        });
    }
};

// The promise consumer :
Dialog.confirm(options).then(() => thisFunctionIsNeverCalledOnFirefox());

By tracing the code with some console.logs, I see that the resolve in makeSilent is called, but after that, nothing more happens. No errors in the console.
I also tried to remove makeSilent by replacing .click(makeSilent(resolve)) with .click(resolve), but it's doesn't work too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions