src: ensure v8::Eternal is empty before setting it

V8 does not check this for us, but this is a requirement of the API.

PR-URL: https://github.com/nodejs/node/pull/59825
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
Anna Henningsen authored and Antoine du Hamel committed 2025-10-07 17:29:34 +02:00
1 parent 12e553529c
commit bb6fd7c2d1
1 file changed
+1
+1
View File
@@ -873,6 +873,7 @@ void Environment::set_process_exit_handler(
return PropertyName##_.Get(isolate_); \
} \
inline void IsolateData::set_##PropertyName(v8::Local<TypeName> value) { \
CHECK(PropertyName##_.IsEmpty()); \
PropertyName##_.Set(isolate_, value); \
}
PER_ISOLATE_TEMPLATE_PROPERTIES(V)