v8
3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Public Member Functions | |
void | Set (Handle< String > name, Handle< Data > value, PropertyAttribute attributes=None) |
V8_INLINE void | Set (Isolate *isolate, const char *name, Handle< Data > value) |
void | SetAccessorProperty (Local< String > 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) |
bool | SetDeclaredAccessor (Local< String > name, Local< DeclaredAccessorDescriptor > descriptor, PropertyAttribute attribute=None, Local< AccessorSignature > signature=Local< AccessorSignature >(), AccessControl settings=DEFAULT) |
Friends | |
class | ObjectTemplate |
class | FunctionTemplate |
void Set | ( | v8::Handle< String > | name, |
v8::Handle< Data > | value, | ||
v8::PropertyAttribute | attribute = None |
||
) |
Adds a property to each instance created by this template.
Definition at line 841 of file api.cc.
References ENTER_V8, name, and Integer::New().
Referenced by CreateGlobalTemplate(), CreateShellContext(), JsHttpRequestProcessor::Initialize(), RunMain(), TEST(), RequestInterruptTestWithMethodCall::TestBody(), RequestInterruptTestWithMethodCallAndInterceptor::TestBody(), TestFastReturnValues(), THREADED_PROFILED_TEST(), and THREADED_TEST().
void Set | ( | Isolate * | isolate, |
const char * | name, | ||
v8::Handle< Data > | value | ||
) |
Definition at line 6134 of file v8.h.
References String::NewFromUtf8().
void SetAccessorProperty | ( | Local< String > | name, |
v8::Local< FunctionTemplate > | getter = Local<FunctionTemplate>() , |
||
v8::Local< FunctionTemplate > | setter = Local<FunctionTemplate>() , |
||
v8::PropertyAttribute | attribute = None , |
||
v8::AccessControl | access_control = DEFAULT |
||
) |
Definition at line 857 of file api.cc.
References ASSERT, ENTER_V8, Handle< T >::IsEmpty(), name, Integer::New(), and Utils::OpenHandle().
Referenced by TEST(), RequestInterruptTestWithAccessor::TestBody(), and THREADED_TEST().
bool SetDeclaredAccessor | ( | Local< String > | name, |
Local< DeclaredAccessorDescriptor > | descriptor, | ||
PropertyAttribute | attribute = None , |
||
Local< AccessorSignature > | signature = Local<AccessorSignature>() , |
||
AccessControl | settings = DEFAULT |
||
) |
void SetNativeDataProperty | ( | v8::Local< String > | name, |
AccessorGetterCallback | getter, | ||
AccessorSetterCallback | setter = 0 , |
||
v8::Handle< Value > | data = Handle<Value>() , |
||
PropertyAttribute | attribute = None , |
||
v8::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.
name | The name of the property for which an accessor is added. |
getter | The callback to invoke when getting the property. |
setter | The callback to invoke when setting the property. |
data | A piece of data that will be passed to the getter and setter callbacks whenever they are invoked. |
settings | Access 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. |
attribute | The attributes of the property for which an accessor is added. |
signature | The 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. |
|
friend |
|
friend |