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

es2022 support #214

Open
3 of 6 tasks
aladdin-add opened this issue Mar 31, 2022 · 2 comments
Open
3 of 6 tasks

es2022 support #214

aladdin-add opened this issue Mar 31, 2022 · 2 comments

Comments

@aladdin-add
Copy link
Collaborator

aladdin-add commented Mar 31, 2022

@aladdin-add
Copy link
Collaborator Author

TLA has been supported,
class fields is still in next => need be enabled by default.

@julianjensen
Copy link

I see that top-level await has been checked above. Not sure if it's still in the works or not but, just in case, I thought I'd post this here to make sure that this is an upcoming feature and not a bug. Currently, for await when used as a top-level await is failing on version 4.2.1.

import { parse } from 'meriyah';

const parseExample = ( name, source ) => {
    try
    {
        parse( source, { module: true, next: true });
        console.log( `PASS: ${name}` );
    }
    catch
    {
        console.warn( `FAIL: ${name}` );
    }
};

parseExample( `async function with 'for await'`, `async function x() { for await ( const a of b ) console.log( 'Works!' ); }` );
parseExample( `top-level 'await'`, `await topLevelAwaitFunction( 'Works' );` );
parseExample( `top-level 'for await'`, `for await ( const a of b ) console.log( 'Also breaks' );` );

The above outputs:

PASS: async function with 'for await'
PASS: top-level 'await'
FAIL: top-level 'for await'

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

No branches or pull requests

2 participants