Skip to content

Commit 0d8205f

Browse files
Apply suggestions from code review
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
1 parent f335723 commit 0d8205f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node_contextify.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ bool ContextifyContext::ShouldRetryAsESMInternal(Environment* env,
15091509
Local<String> code) {
15101510
Isolate* isolate = env->isolate();
15111511

1512-
Local<String> script_id = FIXED_ONE_BYTE_STRING(isolate, "throwaway");
1512+
Local<String> script_id = FIXED_ONE_BYTE_STRING(isolate, "[retry_as_esm_check]");
15131513
Local<Symbol> id_symbol = Symbol::New(isolate, script_id);
15141514

15151515
Local<PrimitiveArray> host_defined_options =
@@ -1527,10 +1527,10 @@ bool ContextifyContext::ShouldRetryAsESMInternal(Environment* env,
15271527
// module variables, or a top-level `await`.
15281528
code = String::Concat(
15291529
isolate,
1530-
String::NewFromUtf8(isolate, "(async function() {").ToLocalChecked(),
1530+
FIXED_ONE_BYTE_STRING(isolate, "(async function() {"),
15311531
code);
15321532
code = String::Concat(
1533-
isolate, code, String::NewFromUtf8(isolate, "})();").ToLocalChecked());
1533+
isolate, code, FIXED_ONE_BYTE_STRING(isolate, "})();"));
15341534

15351535
ScriptCompiler::Source wrapped_source = GetCommonJSSourceInstance(
15361536
isolate, code, script_id, 0, 0, host_defined_options, nullptr);

0 commit comments

Comments
 (0)