Skip to content

Top-level promise for System.import not resolved for dynamically loaded files #4

Open
@pkozlowski-opensource

Description

@pkozlowski-opensource

@caridy I can't send a proper patch atm (will do later today while back at home) but there is a bug in the System.import handling of promises for dynamically loaded files - please notice how resolve is never called when a file is loaded.

I believe that the proper solution is to do:

    import: function(name) {
        var normalizedName = normalizeName(name, []);
        var mod = get(normalizedName);
        return mod ? Promise.resolve(mod) : load(name).then(function () {
            return get(normalizedName);
        });
    },

Does it sound reasonable? If so I will try to submit a PR, including tests (I just need to get familiar with the tools / testing strategy this project is using).

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