Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use std::array
  • Loading branch information
islandryu committed Jun 29, 2025
commit a8a3a33e3b162ea93e535fe28bba907560fcf9c1
10 changes: 5 additions & 5 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1647,11 +1647,11 @@ static const auto throws_only_in_cjs_error_messages =
"await is only valid in async functions and "
"the top level bodies of modules"};

static std::vector<std::string_view> maybe_top_level_await_errors = {
// example: `func(await 1);`
"missing ) after argument list",
// example: `if(await 1)`
"SyntaxError: Unexpected"};
static const auto maybe_top_level_await_errors =
std::array<std::string_view, 2>{// example: `func(await 1);`
"missing ) after argument list",
// example: `if(await 1)`
"SyntaxError: Unexpected"};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the linter/formatter format the code this way?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but now that you mention it, it's a weird format.
I've changed the comment's position.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasnell
Could you take another look when you have a moment?


// If cached_data is provided, it would be used for the compilation and
// the on-disk compilation cache from NODE_COMPILE_CACHE (if configured)
Expand Down