Skip to content

Add dynamic import attributes #1332

@029A-h

Description

@029A-h

According to this: tc39/ecma262#3057 (comment) we are, or very soon will be, at stage 4 with dynamic import attributes.

Dynamic import attributes are still in pending status due to stage 3 (#1111).

Can we now include this feature in Acorn as well?

Motivation
The Node REPL does not support direct dynamic import with await.

> await import('/tmp/data.json', { with: { type: 'json' } });
Uncaught SyntaxError: 
await import('/tmp/data.json', { with: { type: 'json' } })
                                                 ^

Unexpected token ','

This unwanted behavior is caused by Acorn's lack of support for dynamic import attributes (nodejs/node#47463).

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