From 2b2591db528d07587c2a70be3ed3efc55027ed38 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 18 Sep 2025 21:02:05 +0200 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Yagiz Nizipli --- src/module_wrap.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 98e99fba0ce..c78d87d7d97 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -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(), + PropertyAttribute::DontEnum); isolate_data->set_module_wrap_constructor_template(tpl);