本文整理汇总了C++中Local::SetAlignedPointerInInternalField方法的典型用法代码示例。如果您正苦于以下问题:C++ Local::SetAlignedPointerInInternalField方法的具体用法?C++ Local::SetAlignedPointerInInternalField怎么用?C++ Local::SetAlignedPointerInInternalField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Local
的用法示例。
在下文中一共展示了Local::SetAlignedPointerInInternalField方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transfer
void transfer(const FunctionCallbackInfo<Value> &args)
{
/* fd, SSL */
int *fd = new int(dup(args[0]->IntegerValue()));
SSL *ssl = nullptr;
if (args[1]->IsExternal()) {
ssl = (SSL *) args[1].As<External>()->Value();
ssl->references++;
}
Local<Object> ticket = Local<Object>::New(args.GetIsolate(), persistentTicket)->Clone();
ticket->SetAlignedPointerInInternalField(0, fd);
ticket->SetAlignedPointerInInternalField(1, ssl);
args.GetReturnValue().Set(ticket);
}
示例2: wrap
void JavaObject::wrap(Isolate* isolate, Local<Object> jsObject)
{
ASSERT(persistent().IsEmpty());
ASSERT(jsObject->InternalFieldCount() > 0);
jsObject->SetAlignedPointerInInternalField(0, this);
persistent().Reset(isolate, jsObject);
}
示例3: File
static void
gum_v8_file_on_new_file (const FunctionCallbackInfo<Value> & info)
{
GumV8File * self = static_cast<GumV8File *> (
info.Data ().As<External> ()->Value ());
Isolate * isolate = self->core->isolate;
if (!info.IsConstructCall ())
{
isolate->ThrowException (Exception::TypeError (String::NewFromUtf8 (
isolate, "Use `new File()` to create a new instance")));
return;
}
Local<Value> filename_val = info[0];
if (!filename_val->IsString ())
{
isolate->ThrowException (Exception::TypeError (String::NewFromUtf8 (isolate,
"File: first argument must be a string specifying filename")));
return;
}
String::Utf8Value filename (filename_val);
Local<Value> mode_val = info[1];
if (!mode_val->IsString ())
{
isolate->ThrowException (Exception::TypeError (String::NewFromUtf8 (isolate,
"File: second argument must be a string specifying mode")));
return;
}
String::Utf8Value mode (mode_val);
FILE * handle = fopen (*filename, *mode);
if (handle == NULL)
{
gchar * message = g_strdup_printf ("File: failed to open file (%s)",
strerror (errno));
isolate->ThrowException (Exception::TypeError (String::NewFromUtf8 (isolate,
message)));
g_free (message);
return;
}
Local<Object> instance (info.Holder ());
GumFile * file = gum_file_new (instance, handle, self);
instance->SetAlignedPointerInInternalField (0, file);
}
示例4: scope
static void
gum_v8_call_probe_fire (GumCallSite * site,
gpointer user_data)
{
GumV8CallProbe * self = static_cast<GumV8CallProbe *> (user_data);
ScriptScope scope (self->parent->core->script);
Isolate * isolate = self->parent->core->isolate;
Local<ObjectTemplate> probe_args (
Local<ObjectTemplate>::New (isolate, *self->parent->probe_args));
Local<Object> args = probe_args->NewInstance ();
args->SetAlignedPointerInInternalField (0, self);
args->SetAlignedPointerInInternalField (1, site);
Local<Function> callback (Local<Function>::New (isolate, *self->callback));
Local<Value> receiver (Local<Value>::New (isolate, *self->receiver));
Handle<Value> argv[] = { args };
callback->Call (receiver, 1, argv);
}
示例5: wrap
Local<Object> wrap(Local<Object> s)
{
s->SetAlignedPointerInInternalField(0, wsi);
s->SetAlignedPointerInInternalField(1, extension);
return s;
}
示例6:
Handle<Value> wrap_lisp_symbol(Lisp_Object sym) {
Local<Object> obj = symbol_templ->GetFunction()->NewInstance();
//obj->SetInternalField(0, External::New((void*)sym));
obj->SetAlignedPointerInInternalField(0, (void*) sym);
return obj;
}