@@ -6379,14 +6379,33 @@ Local<Value> v8::Object::SlowGetInternalField(int index) {
6379
6379
return Utils::ToLocal (value);
6380
6380
}
6381
6381
6382
- void v8::Object::SetInternalField(int index, v8::Local<Value> value) {
6383
- i::Handle<i::JSReceiver> obj = Utils::OpenHandle(this);
6382
+ template <typename T>
6383
+ void SetInternalFieldImpl (v8::Object* receiver, int index, v8::Local<T> value) {
6384
+ i::Handle <i::JSReceiver> obj = Utils::OpenHandle (receiver);
6384
6385
const char * location = " v8::Object::SetInternalField()" ;
6385
6386
if (!InternalFieldOK (obj, index , location)) return ;
6386
6387
i::Handle <i::Object> val = Utils::OpenHandle (*value);
6387
6388
i::Handle <i::JSObject>::cast (obj)->SetEmbedderField (index , *val);
6388
6389
}
6389
6390
6391
+ void v8::Object::SetInternalField (int index, v8::Local<Value> value) {
6392
+ SetInternalFieldImpl (this , index , value);
6393
+ }
6394
+
6395
+ /* *
6396
+ * These are Node.js-specific extentions used to avoid breaking changes in
6397
+ * Node.js v20.x.
6398
+ */
6399
+ void v8::Object::SetInternalFieldForNodeCore (int index,
6400
+ v8::Local<Module> value) {
6401
+ SetInternalFieldImpl (this , index , value);
6402
+ }
6403
+
6404
+ void v8::Object::SetInternalFieldForNodeCore (int index,
6405
+ v8::Local<UnboundScript> value) {
6406
+ SetInternalFieldImpl (this , index , value);
6407
+ }
6408
+
6390
6409
void * v8::Object::SlowGetAlignedPointerFromInternalField (int index) {
6391
6410
i::Handle <i::JSReceiver> obj = Utils::OpenHandle (this );
6392
6411
const char * location = " v8::Object::GetAlignedPointerFromInternalField()" ;
0 commit comments