Skip to content

Attempting to resolve promises with more than one value #23

@ariesshrimp

Description

@ariesshrimp
// lib/core/file.js
function isDirectoryEmpty(path) {
    return new Promise((resolve, reject) => {
                ...
                resolve(noFilesPresent, path); // I think this is impossible?
                ...
    });
}

I don't think that native promises can be resolved with more than one value. I would expect path to be lost here without fail. I caught this while trying to experimenting with adding Flow type annotations for some inline documentation.

@chalkers, do you know if that's right? Haven't chased the thread here yet to see what the expected behavior is.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions