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 2025-09-11 16:07:36 +02:00 committed by GitHub
parent c742220be9
commit 220baad8ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -839,6 +839,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)