@@ -6338,14 +6338,33 @@ Local<Value> v8::Object::SlowGetInternalField(int index) {
6338
6338
return Utils::ToLocal (value);
6339
6339
}
6340
6340
6341
- void v8::Object::SetInternalField (int index, v8::Local<Value> value) {
6342
- i::Handle<i::JSReceiver> obj = Utils::OpenHandle (this );
6341
+ template <typename T>
6342
+ void SetInternalFieldImpl (v8::Object* receiver, int index, v8::Local<T> value) {
6343
+ i::Handle<i::JSReceiver> obj = Utils::OpenHandle (receiver);
6343
6344
const char * location = " v8::Object::SetInternalField()" ;
6344
6345
if (!InternalFieldOK (obj, index, location)) return ;
6345
6346
i::Handle<i::Object> val = Utils::OpenHandle (*value);
6346
6347
i::Handle<i::JSObject>::cast (obj)->SetEmbedderField (index, *val);
6347
6348
}
6348
6349
6350
+ void v8::Object::SetInternalField (int index, v8::Local<Value> value) {
6351
+ SetInternalFieldImpl (this , index, value);
6352
+ }
6353
+
6354
+ /* *
6355
+ * These are Node.js-specific extentions used to avoid breaking changes in
6356
+ * Node.js v20.x.
6357
+ */
6358
+ void v8::Object::SetInternalFieldForNodeCore (int index,
6359
+ v8::Local<Module> value) {
6360
+ SetInternalFieldImpl (this , index, value);
6361
+ }
6362
+
6363
+ void v8::Object::SetInternalFieldForNodeCore (int index,
6364
+ v8::Local<UnboundScript> value) {
6365
+ SetInternalFieldImpl (this , index, value);
6366
+ }
6367
+
6349
6368
void * v8::Object::SlowGetAlignedPointerFromInternalField (int index) {
6350
6369
i::Handle<i::JSReceiver> obj = Utils::OpenHandle (this );
6351
6370
const char * location = " v8::Object::GetAlignedPointerFromInternalField()" ;
0 commit comments