Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support --experimental-repl-await in babel-node #9329

Open
noinkling opened this issue Jan 14, 2019 · 2 comments
Open

Support --experimental-repl-await in babel-node #9329

noinkling opened this issue Jan 14, 2019 · 2 comments

Comments

@noinkling
Copy link
Contributor

Feature Request

Is your feature request related to a problem? Please describe.
I would like to use "top-level" await in a babel-node REPL. This is doable in vanilla Node with the --experimental-repl-await command line flag. Attempting to run babel-node with this flag currently results in:

  error: unknown option `--experimental-repl-await'

Describe the solution you'd like
Support the Node --experimental-repl-await flag.

Describe alternatives you've considered
There's a top-level await TC39 proposal in the works, but it's still early (stage 2), with plenty of details to be worked out, and there is no Babel implementation yet (if ever?). The repl flag is already implemented in Node and much more limited in scope.

@babel-bot
Copy link
Collaborator

Hey @noinkling! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community
that typically always has someone willing to help. You can sign-up here
for an invite.

@noinkling
Copy link
Contributor Author

noinkling commented Jan 14, 2019

I attempted to allow the flag to test it out, but it looks like there's a conflict with the parser:

$ node_modules/.bin/babel-node --experimental-repl-await
> await Promise.resolve("hello");
{ [SyntaxError: /some_path/repl: await is a reserved word (1:0)

> 1 | await Promise.resolve("hello");
    | ^
]
  pos: 0,
  loc: Position { line: 1, column: 0 },
  code: 'BABEL_PARSE_ERROR' }

I guess it would require a syntax plugin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants