Skip to content

circular dependency (invalid esm) in v5 at /dist/es/Seq.js and dist/es/Collection.js #2019

Closed
@iambumblehead

Description

@iambumblehead

Collection.js imports Seq.js and Seq.js imports Collection.js

Because circular dependencies aren't supported by esm, the files aren't usable as-is and must be transpiled.

Also, these lines in Seq.js look strange.

if ( Collection ) Seq.__proto__ = Collection;
Seq.prototype = Object.create( Collection && Collection.prototype );
Seq.prototype.constructor = Seq;

When Collection is imported through a circular dependency, its value is falsey undefined which causes a runtime error when it is passed to Object.create

related #1961

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