Skip to content

Forbid top-level-await in __syncModuleProgram__ module source protocol #2590

Open
@kriskowal

Description

@kriskowal

Describe the bug

Currently, bundle-source (via @endo/module-source) will happily generate a bundle where a module contains a top-level-await which defers a SyntaxError to runtime, since the enclosing function is not async.

Steps to reproduce

bundle-source entry.mjs where entry.mjs is await null, then run this bundle with importBundle.

Expected behavior

bundle-source should balk because ModuleSource throws a user-meaningful exception like “Endo emulated ModuleSource does not yet support top-level-await”.

Platform environment

Endo at 271aa92

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions