repl: hoist declarations when processing top level await #39265
Conversation
|
@ejose19 awesome work on the PR, this is looking really great and nice to see full destructuring support. Can we add some of the following test cases please:
|
Can you please put each test case along with the expected result? It's not clear for me based on that alone what should be the result. This one node/test/parallel/test-repl-preprocess-top-level-await.js Lines 35 to 36 in a1d5b9c |
|
I've added what I think the extra tests should be. Note that the "scope checking" is the primary feature based on scope context being global or not. |
bfc609e
to
f5f305e
|
Looks good to me. Can you think of any other cases? |
|
@guybedford now that you mention it, we can add some BTW: What I need to do to fix |
You don't need to fix it for the PR to land, it is usually done by the collaborator landing the commit – squashing commits and force pushing tend to make reviewing PRs harder IMHO, so I would recommend to ignore it for this time. |
|
@ejose19 I would really like to see this feature move towards stability for unflagging, so if you think some cases of It looks like the |
I was only working on |
|
Ok, added many new cases and fixed the issues with the other test suite. |
|
Ping for more reviewers - @nodejs/repl |
PR-URL: #39265 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in 394fdec. Congrats on your first Node.js contribution! |
PR-URL: #39265 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Fixes #39259
This PR hoist all declarations as
letin order to allow previous declarations be available for new statements, while also remaining compatible with strict mode.