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 authored and Michaël Zasso committed 2025-09-24 09:03:41 +02:00
1 parent 6790093fcb
commit 2b2591db52
1 file changed
+5 -1
+5 -1
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);