V8 Project
v8::Signature Class Reference

A Signature specifies which receivers and arguments are valid parameters to a function. More...

#include <v8.h>

+ Inheritance diagram for v8::Signature:
+ Collaboration diagram for v8::Signature:

Static Public Member Functions

static Local< SignatureNew (Isolate *isolate, Handle< FunctionTemplate > receiver=Handle< FunctionTemplate >(), int argc=0, Handle< FunctionTemplate > argv[]=0)
 

Private Member Functions

 Signature ()
 

Detailed Description

A Signature specifies which receivers and arguments are valid parameters to a function.

Definition at line 3892 of file v8.h.

Constructor & Destructor Documentation

◆ Signature()

v8::Signature::Signature ( )
private

Member Function Documentation

◆ New()

Local< Signature > v8::Signature::New ( Isolate isolate,
Handle< FunctionTemplate receiver = Handle<FunctionTemplate>(),
int  argc = 0,
Handle< FunctionTemplate argv[] = 0 
)
static

Definition at line 918 of file api.cc.

920  {
921  i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
922  LOG_API(i_isolate, "Signature::New");
923  ENTER_V8(i_isolate);
924  i::Handle<i::Struct> struct_obj =
925  i_isolate->factory()->NewStruct(i::SIGNATURE_INFO_TYPE);
928  if (!receiver.IsEmpty()) obj->set_receiver(*Utils::OpenHandle(*receiver));
929  if (argc > 0) {
930  i::Handle<i::FixedArray> args = i_isolate->factory()->NewFixedArray(argc);
931  for (int i = 0; i < argc; i++) {
932  if (!argv[i].IsEmpty())
933  args->set(i, *Utils::OpenHandle(*argv[i]));
934  }
935  obj->set_args(*args);
936  }
937  return Utils::ToLocal(obj);
938 }
#define LOG_API(isolate, expr)
Definition: api.cc:52
#define ENTER_V8(isolate)
Definition: api.cc:54
static Local< Context > ToLocal(v8::internal::Handle< v8::internal::Context > obj)
static v8::internal::Handle< To > OpenHandle(v8::Local< From > handle)
Definition: api.h:288
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
Factory * factory()
Definition: isolate.h:982
@ SIGNATURE_INFO_TYPE
Definition: objects.h:705

References v8::internal::Handle< T >::cast(), ENTER_V8, v8::internal::Isolate::factory(), v8::Handle< T >::IsEmpty(), LOG_API, v8::Utils::OpenHandle(), v8::internal::SIGNATURE_INFO_TYPE, and v8::Utils::ToLocal().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: