V8 Project
v8::ObjectTemplate Class Reference

An ObjectTemplate is used to create objects at runtime. More...

#include <v8.h>

+ Inheritance diagram for v8::ObjectTemplate:
+ Collaboration diagram for v8::ObjectTemplate:

Public Member Functions

Local< ObjectNewInstance ()
 Creates a new instance of this template. More...
 
void SetAccessor (Handle< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None, Handle< AccessorSignature > signature=Handle< AccessorSignature >())
 Sets an accessor on the object template. More...
 
void SetAccessor (Handle< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None, Handle< AccessorSignature > signature=Handle< AccessorSignature >())
 
void SetNamedPropertyHandler (NamedPropertyGetterCallback getter, NamedPropertySetterCallback setter=0, NamedPropertyQueryCallback query=0, NamedPropertyDeleterCallback deleter=0, NamedPropertyEnumeratorCallback enumerator=0, Handle< Value > data=Handle< Value >())
 Sets a named property handler on the object template. More...
 
void SetIndexedPropertyHandler (IndexedPropertyGetterCallback getter, IndexedPropertySetterCallback setter=0, IndexedPropertyQueryCallback query=0, IndexedPropertyDeleterCallback deleter=0, IndexedPropertyEnumeratorCallback enumerator=0, Handle< Value > data=Handle< Value >())
 Sets an indexed property handler on the object template. More...
 
void SetCallAsFunctionHandler (FunctionCallback callback, Handle< Value > data=Handle< Value >())
 Sets the callback to be used when calling instances created from this template as a function. More...
 
void MarkAsUndetectable ()
 Mark object instances of the template as undetectable. More...
 
void SetAccessCheckCallbacks (NamedSecurityCallback named_handler, IndexedSecurityCallback indexed_handler, Handle< Value > data=Handle< Value >(), bool turned_on_by_default=true)
 Sets access check callbacks on the object template. More...
 
int InternalFieldCount ()
 Gets the number of internal fields for objects generated from this template. More...
 
void SetInternalFieldCount (int value)
 Sets the number of internal fields for objects generated from this template. More...
 
- Public Member Functions inherited from v8::Template
void Set (Handle< Name > name, Handle< Data > value, PropertyAttribute attributes=None)
 Adds a property to each instance created by this template. More...
 
void Set (Isolate *isolate, const char *name, Handle< Data > value)
 
void SetAccessorProperty (Local< Name > name, Local< FunctionTemplate > getter=Local< FunctionTemplate >(), Local< FunctionTemplate > setter=Local< FunctionTemplate >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT)
 
void SetNativeDataProperty (Local< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=0, Handle< Value > data=Handle< Value >(), PropertyAttribute attribute=None, Local< AccessorSignature > signature=Local< AccessorSignature >(), AccessControl settings=DEFAULT)
 Whenever the property with the given name is accessed on objects created from this Template the getter and setter callbacks are called instead of getting and setting the property directly on the JavaScript object. More...
 
void SetNativeDataProperty (Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=0, Handle< Value > data=Handle< Value >(), PropertyAttribute attribute=None, Local< AccessorSignature > signature=Local< AccessorSignature >(), AccessControl settings=DEFAULT)
 
bool SetDeclaredAccessor (Local< Name > name, Local< DeclaredAccessorDescriptor > descriptor, PropertyAttribute attribute=None, Local< AccessorSignature > signature=Local< AccessorSignature >(), AccessControl settings=DEFAULT)
 

Static Public Member Functions

static Local< ObjectTemplateNew (Isolate *isolate)
 Creates an ObjectTemplate. More...
 
static Local< ObjectTemplateNew ()
 

Private Member Functions

 ObjectTemplate ()
 

Static Private Member Functions

static Local< ObjectTemplateNew (internal::Isolate *isolate, Handle< FunctionTemplate > constructor)
 

Friends

class FunctionTemplate
 

Detailed Description

An ObjectTemplate is used to create objects at runtime.

Properties added to an ObjectTemplate are added to each object created from the ObjectTemplate.

Definition at line 3728 of file v8.h.

Constructor & Destructor Documentation

◆ ObjectTemplate()

v8::ObjectTemplate::ObjectTemplate ( )
private

Member Function Documentation

◆ InternalFieldCount()

int v8::ObjectTemplate::InternalFieldCount ( )

Gets the number of internal fields for objects generated from this template.

Definition at line 1528 of file api.cc.

1528  {
1529  return i::Smi::cast(Utils::OpenHandle(this)->internal_field_count())->value();
1530 }
static v8::internal::Handle< To > OpenHandle(v8::Local< From > handle)
Definition: api.h:288
kSerializedDataOffset kPrototypeTemplateOffset kIndexedPropertyHandlerOffset kInstanceCallHandlerOffset internal_field_count
Definition: objects-inl.h:5340

References v8::internal::internal_field_count, and v8::Utils::OpenHandle().

+ Here is the call graph for this function:

◆ MarkAsUndetectable()

void v8::ObjectTemplate::MarkAsUndetectable ( )

Mark object instances of the template as undetectable.

In many ways, undetectable objects behave as though they are not there. They behave like 'undefined' in conditionals and when printed. However, properties can be accessed and called as on normal objects.

Definition at line 1430 of file api.cc.

1430  {
1431  i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1432  ENTER_V8(isolate);
1433  i::HandleScope scope(isolate);
1434  EnsureConstructor(isolate, this);
1435  i::FunctionTemplateInfo* constructor =
1436  i::FunctionTemplateInfo::cast(Utils::OpenHandle(this)->constructor());
1437  i::Handle<i::FunctionTemplateInfo> cons(constructor);
1438  cons->set_undetectable(true);
1439 }
#define ENTER_V8(isolate)
Definition: api.cc:54
static i::Handle< i::FunctionTemplateInfo > EnsureConstructor(i::Isolate *isolate, ObjectTemplate *object_template)
Definition: api.cc:1268

References v8::EnsureConstructor(), ENTER_V8, and v8::Utils::OpenHandle().

+ Here is the call graph for this function:

◆ New() [1/3]

Local< ObjectTemplate > v8::ObjectTemplate::New ( )
static

Definition at line 1244 of file api.cc.

1244  {
1245  return New(i::Isolate::Current(), Local<FunctionTemplate>());
1246 }
static Local< ObjectTemplate > New()
Definition: api.cc:1244

Referenced by v8::CreateEnvironment(), v8::Shell::CreateGlobalTemplate(), v8::internal::anonymous_namespace{i18n.cc}::GetEternal(), v8::FunctionTemplate::InstanceTemplate(), New(), and v8::FunctionTemplate::PrototypeTemplate().

+ Here is the caller graph for this function:

◆ New() [2/3]

Local< ObjectTemplate > v8::ObjectTemplate::New ( internal::Isolate isolate,
v8::Handle< FunctionTemplate constructor 
)
staticprivate

Definition at line 1249 of file api.cc.

1251  {
1252  LOG_API(isolate, "ObjectTemplate::New");
1253  ENTER_V8(isolate);
1254  i::Handle<i::Struct> struct_obj =
1255  isolate->factory()->NewStruct(i::OBJECT_TEMPLATE_INFO_TYPE);
1259  if (!constructor.IsEmpty())
1260  obj->set_constructor(*Utils::OpenHandle(*constructor));
1261  obj->set_internal_field_count(i::Smi::FromInt(0));
1262  return Utils::ToLocal(obj);
1263 }
#define LOG_API(isolate, expr)
Definition: api.cc:52
@ OBJECT_TEMPLATE
Definition: api.h:26
bool IsEmpty() const
Returns true if the handle is empty.
Definition: v8.h:228
static Local< Context > ToLocal(v8::internal::Handle< v8::internal::Context > obj)
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
@ OBJECT_TEMPLATE_INFO_TYPE
Definition: objects.h:704
static void InitializeTemplate(i::Handle< i::TemplateInfo > that, int type)
Definition: api.cc:777

References v8::internal::Handle< T >::cast(), ENTER_V8, v8::internal::Isolate::factory(), v8::internal::Smi::FromInt(), v8::InitializeTemplate(), v8::Handle< T >::IsEmpty(), LOG_API, v8::Consts::OBJECT_TEMPLATE, v8::internal::OBJECT_TEMPLATE_INFO_TYPE, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().

+ Here is the call graph for this function:

◆ New() [3/3]

Local< ObjectTemplate > v8::ObjectTemplate::New ( Isolate isolate)
static

Creates an ObjectTemplate.

Definition at line 1239 of file api.cc.

1239  {
1240  return New(reinterpret_cast<i::Isolate*>(isolate), Local<FunctionTemplate>());
1241 }

References New().

+ Here is the call graph for this function:

◆ NewInstance()

Local< v8::Object > v8::ObjectTemplate::NewInstance ( )

Creates a new instance of this template.

Definition at line 5312 of file api.cc.

5312  {
5313  i::Isolate* isolate = i::Isolate::Current();
5314  ON_BAILOUT(isolate, "v8::ObjectTemplate::NewInstance()",
5315  return Local<v8::Object>());
5316  LOG_API(isolate, "ObjectTemplate::NewInstance");
5317  ENTER_V8(isolate);
5318  EXCEPTION_PREAMBLE(isolate);
5320  has_pending_exception = !i::Execution::InstantiateObject(
5321  Utils::OpenHandle(this)).ToHandle(&obj);
5322  EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::Object>());
5324 }
#define ON_BAILOUT(isolate, location, code)
Definition: api.cc:60
#define EXCEPTION_BAILOUT_CHECK(isolate, value)
Definition: api.cc:93
#define EXCEPTION_PREAMBLE(isolate)
Definition: api.cc:67

References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().

+ Here is the call graph for this function:

◆ SetAccessCheckCallbacks()

void v8::ObjectTemplate::SetAccessCheckCallbacks ( NamedSecurityCallback  named_handler,
IndexedSecurityCallback  indexed_handler,
Handle< Value data = Handle<Value>(),
bool  turned_on_by_default = true 
)

Sets access check callbacks on the object template.

When accessing properties on instances of this object template, the access check callback will be called to determine whether or not to allow cross-context access to the properties. The last parameter specifies whether access checks are turned on by default on instances. If access checks are off by default, they can be turned on on individual instances by calling Object::TurnOnAccessCheck().

Definition at line 1442 of file api.cc.

1446  {
1447  i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1448  ENTER_V8(isolate);
1449  i::HandleScope scope(isolate);
1450  EnsureConstructor(isolate, this);
1451 
1452  i::Handle<i::Struct> struct_info =
1453  isolate->factory()->NewStruct(i::ACCESS_CHECK_INFO_TYPE);
1456 
1457  SET_FIELD_WRAPPED(info, set_named_callback, named_callback);
1458  SET_FIELD_WRAPPED(info, set_indexed_callback, indexed_callback);
1459 
1460  if (data.IsEmpty()) {
1461  data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
1462  }
1463  info->set_data(*Utils::OpenHandle(*data));
1464 
1465  i::FunctionTemplateInfo* constructor =
1466  i::FunctionTemplateInfo::cast(Utils::OpenHandle(this)->constructor());
1467  i::Handle<i::FunctionTemplateInfo> cons(constructor);
1468  cons->set_access_check_info(*info);
1469  cons->set_needs_access_check(turned_on_by_default);
1470 }
#define SET_FIELD_WRAPPED(obj, setter, cdata)
Definition: api.cc:1101
Isolate represents an isolated instance of the V8 engine.
Definition: v8.h:4356
Factory * factory()
Definition: isolate.h:982
@ ACCESS_CHECK_INFO_TYPE
Definition: objects.h:700
Handle< Primitive > Undefined(Isolate *isolate)
Definition: v8.h:6836

References v8::internal::ACCESS_CHECK_INFO_TYPE, v8::internal::Handle< T >::cast(), v8::EnsureConstructor(), ENTER_V8, v8::internal::Isolate::factory(), v8::Handle< T >::IsEmpty(), v8::Utils::OpenHandle(), SET_FIELD_WRAPPED, and v8::Undefined().

+ Here is the call graph for this function:

◆ SetAccessor() [1/2]

void v8::ObjectTemplate::SetAccessor ( v8::Handle< Name name,
AccessorNameGetterCallback  getter,
AccessorNameSetterCallback  setter = 0,
v8::Handle< Value data = Handle<Value>(),
AccessControl  settings = DEFAULT,
PropertyAttribute  attribute = None,
v8::Handle< AccessorSignature signature = Handle<AccessorSignature>() 
)

Definition at line 1385 of file api.cc.

1391  {
1393  this, name, getter, setter, data, settings, attribute, signature);
1394 }
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
static bool TemplateSetAccessor(Template *template_obj, v8::Local< Name > name, Getter getter, Setter setter, Data data, AccessControl settings, PropertyAttribute attribute, v8::Local< AccessorSignature > signature)
Definition: api.cc:1316

References name, and v8::TemplateSetAccessor().

+ Here is the call graph for this function:

◆ SetAccessor() [2/2]

void v8::ObjectTemplate::SetAccessor ( v8::Handle< String name,
AccessorGetterCallback  getter,
AccessorSetterCallback  setter = 0,
v8::Handle< Value data = Handle<Value>(),
AccessControl  settings = DEFAULT,
PropertyAttribute  attribute = None,
v8::Handle< AccessorSignature signature = Handle<AccessorSignature>() 
)

Sets an accessor on the object template.

Whenever the property with the given name is accessed on objects created from this ObjectTemplate the getter and setter callbacks are called instead of getting and setting the property directly on the JavaScript object.

Parameters
nameThe name of the property for which an accessor is added.
getterThe callback to invoke when getting the property.
setterThe callback to invoke when setting the property.
dataA piece of data that will be passed to the getter and setter callbacks whenever they are invoked.
settingsAccess control settings for the accessor. This is a bit field consisting of one of more of DEFAULT = 0, ALL_CAN_READ = 1, or ALL_CAN_WRITE = 2. The default is to not allow cross-context access. ALL_CAN_READ means that all cross-context reads are allowed. ALL_CAN_WRITE means that all cross-context writes are allowed. The combination ALL_CAN_READ | ALL_CAN_WRITE can be used to allow all cross-context access.
attributeThe attributes of the property for which an accessor is added.
signatureThe signature describes valid receivers for the accessor and is used to perform implicit instance checks against them. If the receiver is incompatible (i.e. is not an instance of the constructor as defined by FunctionTemplate::HasInstance()), an implicit TypeError is thrown and no callback is invoked.

Definition at line 1373 of file api.cc.

1379  {
1381  this, name, getter, setter, data, settings, attribute, signature);
1382 }

References name, and v8::TemplateSetAccessor().

+ Here is the call graph for this function:

◆ SetCallAsFunctionHandler()

void v8::ObjectTemplate::SetCallAsFunctionHandler ( FunctionCallback  callback,
Handle< Value data = Handle<Value>() 
)

Sets the callback to be used when calling instances created from this template as a function.

If no callback is set, instances behave like normal JavaScript objects that cannot be called as a function.

Definition at line 1506 of file api.cc.

1507  {
1508  i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1509  ENTER_V8(isolate);
1510  i::HandleScope scope(isolate);
1511  EnsureConstructor(isolate, this);
1512  i::FunctionTemplateInfo* constructor = i::FunctionTemplateInfo::cast(
1513  Utils::OpenHandle(this)->constructor());
1514  i::Handle<i::FunctionTemplateInfo> cons(constructor);
1515  i::Handle<i::Struct> struct_obj =
1516  isolate->factory()->NewStruct(i::CALL_HANDLER_INFO_TYPE);
1519  SET_FIELD_WRAPPED(obj, set_callback, callback);
1520  if (data.IsEmpty()) {
1521  data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
1522  }
1523  obj->set_data(*Utils::OpenHandle(*data));
1524  cons->set_instance_call_handler(*obj);
1525 }
@ CALL_HANDLER_INFO_TYPE
Definition: objects.h:702

References v8::internal::CALL_HANDLER_INFO_TYPE, v8::internal::Handle< T >::cast(), v8::EnsureConstructor(), ENTER_V8, v8::internal::Isolate::factory(), v8::Handle< T >::IsEmpty(), v8::Utils::OpenHandle(), SET_FIELD_WRAPPED, and v8::Undefined().

+ Here is the call graph for this function:

◆ SetIndexedPropertyHandler()

void v8::ObjectTemplate::SetIndexedPropertyHandler ( IndexedPropertyGetterCallback  getter,
IndexedPropertySetterCallback  setter = 0,
IndexedPropertyQueryCallback  query = 0,
IndexedPropertyDeleterCallback  deleter = 0,
IndexedPropertyEnumeratorCallback  enumerator = 0,
Handle< Value data = Handle<Value>() 
)

Sets an indexed property handler on the object template.

Whenever an indexed property is accessed on objects created from this object template, the provided callback is invoked instead of accessing the property directly on the JavaScript object.

Parameters
getterThe callback to invoke when getting a property.
setterThe callback to invoke when setting a property.
queryThe callback to invoke to check if an object has a property.
deleterThe callback to invoke when deleting a property.
enumeratorThe callback to invoke to enumerate all the indexed properties of an object.
dataA piece of data that will be passed to the callbacks whenever they are invoked.

Definition at line 1473 of file api.cc.

1479  {
1480  i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1481  ENTER_V8(isolate);
1482  i::HandleScope scope(isolate);
1483  EnsureConstructor(isolate, this);
1484  i::FunctionTemplateInfo* constructor = i::FunctionTemplateInfo::cast(
1485  Utils::OpenHandle(this)->constructor());
1486  i::Handle<i::FunctionTemplateInfo> cons(constructor);
1487  i::Handle<i::Struct> struct_obj =
1488  isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE);
1491 
1492  if (getter != 0) SET_FIELD_WRAPPED(obj, set_getter, getter);
1493  if (setter != 0) SET_FIELD_WRAPPED(obj, set_setter, setter);
1494  if (query != 0) SET_FIELD_WRAPPED(obj, set_query, query);
1495  if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover);
1496  if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator);
1497 
1498  if (data.IsEmpty()) {
1499  data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
1500  }
1501  obj->set_data(*Utils::OpenHandle(*data));
1502  cons->set_indexed_property_handler(*obj);
1503 }
@ INTERCEPTOR_INFO_TYPE
Definition: objects.h:701

References v8::internal::Handle< T >::cast(), v8::EnsureConstructor(), ENTER_V8, v8::internal::Isolate::factory(), v8::internal::INTERCEPTOR_INFO_TYPE, v8::Handle< T >::IsEmpty(), v8::Utils::OpenHandle(), SET_FIELD_WRAPPED, and v8::Undefined().

+ Here is the call graph for this function:

◆ SetInternalFieldCount()

void v8::ObjectTemplate::SetInternalFieldCount ( int  value)

Sets the number of internal fields for objects generated from this template.

Definition at line 1533 of file api.cc.

1533  {
1534  i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1535  if (!Utils::ApiCheck(i::Smi::IsValid(value),
1536  "v8::ObjectTemplate::SetInternalFieldCount()",
1537  "Invalid internal field count")) {
1538  return;
1539  }
1540  ENTER_V8(isolate);
1541  if (value > 0) {
1542  // The internal field count is set by the constructor function's
1543  // construct code, so we ensure that there is a constructor
1544  // function to do the setting.
1545  EnsureConstructor(isolate, this);
1546  }
1547  Utils::OpenHandle(this)->set_internal_field_count(i::Smi::FromInt(value));
1548 }
static bool ApiCheck(bool condition, const char *location, const char *message)
Definition: api.h:177
static bool IsValid(intptr_t value)
Definition: objects-inl.h:1334

References v8::Utils::ApiCheck(), v8::EnsureConstructor(), ENTER_V8, v8::internal::Smi::FromInt(), v8::internal::Smi::IsValid(), and v8::Utils::OpenHandle().

+ Here is the call graph for this function:

◆ SetNamedPropertyHandler()

void v8::ObjectTemplate::SetNamedPropertyHandler ( NamedPropertyGetterCallback  getter,
NamedPropertySetterCallback  setter = 0,
NamedPropertyQueryCallback  query = 0,
NamedPropertyDeleterCallback  deleter = 0,
NamedPropertyEnumeratorCallback  enumerator = 0,
Handle< Value data = Handle<Value>() 
)

Sets a named property handler on the object template.

Whenever a property whose name is a string is accessed on objects created from this object template, the provided callback is invoked instead of accessing the property directly on the JavaScript object.

Parameters
getterThe callback to invoke when getting a property.
setterThe callback to invoke when setting a property.
queryThe callback to invoke to check if a property is present, and if present, get its attributes.
deleterThe callback to invoke when deleting a property.
enumeratorThe callback to invoke to enumerate all the named properties of an object.
dataA piece of data that will be passed to the callbacks whenever they are invoked.

Definition at line 1397 of file api.cc.

1403  {
1404  i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1405  ENTER_V8(isolate);
1406  i::HandleScope scope(isolate);
1407  EnsureConstructor(isolate, this);
1408  i::FunctionTemplateInfo* constructor = i::FunctionTemplateInfo::cast(
1409  Utils::OpenHandle(this)->constructor());
1410  i::Handle<i::FunctionTemplateInfo> cons(constructor);
1411  i::Handle<i::Struct> struct_obj =
1412  isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE);
1415 
1416  if (getter != 0) SET_FIELD_WRAPPED(obj, set_getter, getter);
1417  if (setter != 0) SET_FIELD_WRAPPED(obj, set_setter, setter);
1418  if (query != 0) SET_FIELD_WRAPPED(obj, set_query, query);
1419  if (remover != 0) SET_FIELD_WRAPPED(obj, set_deleter, remover);
1420  if (enumerator != 0) SET_FIELD_WRAPPED(obj, set_enumerator, enumerator);
1421 
1422  if (data.IsEmpty()) {
1423  data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
1424  }
1425  obj->set_data(*Utils::OpenHandle(*data));
1426  cons->set_named_property_handler(*obj);
1427 }

References v8::internal::Handle< T >::cast(), v8::EnsureConstructor(), ENTER_V8, v8::internal::Isolate::factory(), v8::internal::INTERCEPTOR_INFO_TYPE, v8::Handle< T >::IsEmpty(), v8::Utils::OpenHandle(), SET_FIELD_WRAPPED, and v8::Undefined().

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ FunctionTemplate

friend class FunctionTemplate
friend

Definition at line 3884 of file v8.h.


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