@@ -392,6 +392,25 @@ void SetMethod(v8::Isolate* isolate,
392
392
that->Set (name_string, t);
393
393
}
394
394
395
+ void SetFastMethod (Isolate* isolate,
396
+ Local<Template> that,
397
+ const char * name,
398
+ v8::FunctionCallback slow_callback,
399
+ const v8::CFunction* c_function) {
400
+ Local<v8::FunctionTemplate> t =
401
+ NewFunctionTemplate (isolate,
402
+ slow_callback,
403
+ Local<v8::Signature>(),
404
+ v8::ConstructorBehavior::kThrow ,
405
+ v8::SideEffectType::kHasSideEffect ,
406
+ c_function);
407
+ // kInternalized strings are created in the old space.
408
+ const v8::NewStringType type = v8::NewStringType::kInternalized ;
409
+ Local<v8::String> name_string =
410
+ v8::String::NewFromUtf8 (isolate, name, type).ToLocalChecked ();
411
+ that->Set (name_string, t);
412
+ }
413
+
395
414
void SetFastMethod (Local<v8::Context> context,
396
415
Local<v8::Object> that,
397
416
const char * name,
@@ -434,6 +453,25 @@ void SetFastMethodNoSideEffect(Local<v8::Context> context,
434
453
that->Set (context, name_string, function).Check ();
435
454
}
436
455
456
+ void SetFastMethodNoSideEffect (Isolate* isolate,
457
+ Local<Template> that,
458
+ const char * name,
459
+ v8::FunctionCallback slow_callback,
460
+ const v8::CFunction* c_function) {
461
+ Local<v8::FunctionTemplate> t =
462
+ NewFunctionTemplate (isolate,
463
+ slow_callback,
464
+ Local<v8::Signature>(),
465
+ v8::ConstructorBehavior::kThrow ,
466
+ v8::SideEffectType::kHasNoSideEffect ,
467
+ c_function);
468
+ // kInternalized strings are created in the old space.
469
+ const v8::NewStringType type = v8::NewStringType::kInternalized ;
470
+ Local<v8::String> name_string =
471
+ v8::String::NewFromUtf8 (isolate, name, type).ToLocalChecked ();
472
+ that->Set (name_string, t);
473
+ }
474
+
437
475
void SetMethodNoSideEffect (Local<v8::Context> context,
438
476
Local<v8::Object> that,
439
477
const char * name,
@@ -455,6 +493,23 @@ void SetMethodNoSideEffect(Local<v8::Context> context,
455
493
function->SetName (name_string); // NODE_SET_METHOD() compatibility.
456
494
}
457
495
496
+ void SetMethodNoSideEffect (Isolate* isolate,
497
+ Local<v8::Template> that,
498
+ const char * name,
499
+ v8::FunctionCallback callback) {
500
+ Local<v8::FunctionTemplate> t =
501
+ NewFunctionTemplate (isolate,
502
+ callback,
503
+ Local<v8::Signature>(),
504
+ v8::ConstructorBehavior::kThrow ,
505
+ v8::SideEffectType::kHasNoSideEffect );
506
+ // kInternalized strings are created in the old space.
507
+ const v8::NewStringType type = v8::NewStringType::kInternalized ;
508
+ Local<v8::String> name_string =
509
+ v8::String::NewFromUtf8 (isolate, name, type).ToLocalChecked ();
510
+ that->Set (name_string, t);
511
+ }
512
+
458
513
void SetProtoMethod (v8::Isolate* isolate,
459
514
Local<v8::FunctionTemplate> that,
460
515
const char * name,
0 commit comments