esm: make hasAsyncGraph non-enumerable

Otherwise the debug() calls would attempt to display it and throws
an error.

PR-URL: https://github.com/nodejs/node/pull/59905
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
Joyee Cheung 2025-09-18 21:02:05 +02:00 committed by GitHub
parent 57f61ad598
commit c7b0dfbd7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,6 +56,7 @@ using v8::ObjectTemplate;
using v8::PrimitiveArray;
using v8::Promise;
using v8::PromiseRejectEvent;
using v8::PropertyAttribute;
using v8::PropertyCallbackInfo;
using v8::ScriptCompiler;
using v8::ScriptOrigin;
@ -1391,7 +1392,10 @@ void ModuleWrap::CreatePerIsolateProperties(IsolateData* isolate_data,
SetConstructorFunction(isolate, target, "ModuleWrap", tpl);
tpl->InstanceTemplate()->SetLazyDataProperty(
FIXED_ONE_BYTE_STRING(isolate, "hasAsyncGraph"), HasAsyncGraph);
FIXED_ONE_BYTE_STRING(isolate, "hasAsyncGraph"),
HasAsyncGraph,
Local<Value>(),
PropertyAttribute::DontEnum);
isolate_data->set_module_wrap_constructor_template(tpl);