Skip to content

Commit 10369fd

Browse files
committed
added to_array
1 parent d714356 commit 10369fd

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/node_contextify.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,7 @@ MaybeLocal<Object> ContextifyFunction::CompileFunctionAndCacheResult(
16221622
// While top-level `await` is not permitted in CommonJS, it returns the same
16231623
// error message as when `await` is used in a sync function, so we don't use it
16241624
// as a disambiguation.
1625-
static const auto esm_syntax_error_messages = std::to_array<std::string_view>{
1625+
static const std::array<std::string_view, 3> esm_syntax_error_messages = {
16261626
"Cannot use import statement outside a module", // `import` statements
16271627
"Unexpected token 'export'", // `export` statements
16281628
"Cannot use 'import.meta' outside a module"}; // `import.meta` references
@@ -1637,8 +1637,7 @@ static const auto esm_syntax_error_messages = std::to_array<std::string_view>{
16371637
// - Top-level `await`: if the user writes `await` at the top level of a
16381638
// CommonJS module, it will throw a syntax error; but the same code is valid
16391639
// in ESM.
1640-
static const auto throws_only_in_cjs_error_messages =
1641-
std::to_array<std::string_view>{
1640+
static const std::array<std::string_view, 6> throws_only_in_cjs_error_messages = {
16421641
"Identifier 'module' has already been declared",
16431642
"Identifier 'exports' has already been declared",
16441643
"Identifier 'require' has already been declared",

0 commit comments

Comments
 (0)