v8.h | v8.h | |||
---|---|---|---|---|
skipping to change at line 1786 | skipping to change at line 1786 | |||
/** | /** | |||
* Returns the value if the setter intercepts the request. | * Returns the value if the setter intercepts the request. | |||
* Otherwise, returns an empty handle. | * Otherwise, returns an empty handle. | |||
*/ | */ | |||
typedef Handle<Value> (*IndexedPropertySetter)(uint32_t index, | typedef Handle<Value> (*IndexedPropertySetter)(uint32_t index, | |||
Local<Value> value, | Local<Value> value, | |||
const AccessorInfo& info); | const AccessorInfo& info); | |||
/** | /** | |||
* Returns a non-empty handle if the interceptor intercepts the request. | * Returns a non-empty handle if the interceptor intercepts the request. | |||
* The result is true if either a boolean (true if property exists and fals | * The result is an integer encoding property attributes. | |||
e | ||||
* otherwise) or an integer encoding property attributes. | ||||
*/ | */ | |||
#ifdef USE_NEW_QUERY_CALLBACKS | ||||
typedef Handle<Integer> (*IndexedPropertyQuery)(uint32_t index, | typedef Handle<Integer> (*IndexedPropertyQuery)(uint32_t index, | |||
const AccessorInfo& info); | const AccessorInfo& info); | |||
#else | ||||
typedef Handle<Boolean> (*IndexedPropertyQuery)(uint32_t index, | ||||
const AccessorInfo& info); | ||||
#endif | ||||
typedef Handle<Value> (*IndexedPropertyQueryImpl)(uint32_t index, | ||||
const AccessorInfo& info) | ||||
; | ||||
/** | /** | |||
* Returns a non-empty handle if the deleter intercepts the request. | * Returns a non-empty handle if the deleter intercepts the request. | |||
* The return value is true if the property could be deleted and false | * The return value is true if the property could be deleted and false | |||
* otherwise. | * otherwise. | |||
*/ | */ | |||
typedef Handle<Boolean> (*IndexedPropertyDeleter)(uint32_t index, | typedef Handle<Boolean> (*IndexedPropertyDeleter)(uint32_t index, | |||
const AccessorInfo& info) ; | const AccessorInfo& info) ; | |||
/** | /** | |||
skipping to change at line 2011 | skipping to change at line 2002 | |||
NamedPropertySetter setter, | NamedPropertySetter setter, | |||
NamedPropertyQuery query, | NamedPropertyQuery query, | |||
NamedPropertyDeleter remover, | NamedPropertyDeleter remover, | |||
NamedPropertyEnumerator enumerator, | NamedPropertyEnumerator enumerator, | |||
Handle<Value> data); | Handle<Value> data); | |||
void SetIndexedInstancePropertyHandler(IndexedPropertyGetter getter, | void SetIndexedInstancePropertyHandler(IndexedPropertyGetter getter, | |||
IndexedPropertySetter setter, | IndexedPropertySetter setter, | |||
IndexedPropertyQuery query, | IndexedPropertyQuery query, | |||
IndexedPropertyDeleter remover, | IndexedPropertyDeleter remover, | |||
IndexedPropertyEnumerator enumerat or, | IndexedPropertyEnumerator enumerat or, | |||
Handle<Value> data) { | Handle<Value> data); | |||
IndexedPropertyQueryImpl casted = | ||||
reinterpret_cast<IndexedPropertyQueryImpl>(query); | ||||
SetIndexedInstancePropertyHandlerImpl(getter, | ||||
setter, | ||||
casted, | ||||
remover, | ||||
enumerator, | ||||
data); | ||||
} | ||||
void SetIndexedInstancePropertyHandlerImpl( | ||||
IndexedPropertyGetter getter, | ||||
IndexedPropertySetter setter, | ||||
IndexedPropertyQueryImpl query, | ||||
IndexedPropertyDeleter remover, | ||||
IndexedPropertyEnumerator enumerator, | ||||
Handle<Value> data); | ||||
void SetInstanceCallAsFunctionHandler(InvocationCallback callback, | void SetInstanceCallAsFunctionHandler(InvocationCallback callback, | |||
Handle<Value> data); | Handle<Value> data); | |||
friend class Context; | friend class Context; | |||
friend class ObjectTemplate; | friend class ObjectTemplate; | |||
}; | }; | |||
/** | /** | |||
* An ObjectTemplate is used to create objects at runtime. | * An ObjectTemplate is used to create objects at runtime. | |||
* | * | |||
skipping to change at line 2125 | skipping to change at line 2100 | |||
* \param enumerator The callback to invoke to enumerate all the indexed | * \param enumerator The callback to invoke to enumerate all the indexed | |||
* properties of an object. | * properties of an object. | |||
* \param data A piece of data that will be passed to the callbacks | * \param data A piece of data that will be passed to the callbacks | |||
* whenever they are invoked. | * whenever they are invoked. | |||
*/ | */ | |||
void SetIndexedPropertyHandler(IndexedPropertyGetter getter, | void SetIndexedPropertyHandler(IndexedPropertyGetter getter, | |||
IndexedPropertySetter setter = 0, | IndexedPropertySetter setter = 0, | |||
IndexedPropertyQuery query = 0, | IndexedPropertyQuery query = 0, | |||
IndexedPropertyDeleter deleter = 0, | IndexedPropertyDeleter deleter = 0, | |||
IndexedPropertyEnumerator enumerator = 0, | IndexedPropertyEnumerator enumerator = 0, | |||
Handle<Value> data = Handle<Value>()) { | Handle<Value> data = Handle<Value>()); | |||
IndexedPropertyQueryImpl casted = | ||||
reinterpret_cast<IndexedPropertyQueryImpl>(query); | ||||
SetIndexedPropertyHandlerImpl(getter, | ||||
setter, | ||||
casted, | ||||
deleter, | ||||
enumerator, | ||||
data); | ||||
} | ||||
private: | ||||
void SetIndexedPropertyHandlerImpl(IndexedPropertyGetter getter, | ||||
IndexedPropertySetter setter, | ||||
IndexedPropertyQueryImpl query, | ||||
IndexedPropertyDeleter deleter, | ||||
IndexedPropertyEnumerator enumerator, | ||||
Handle<Value> data); | ||||
public: | ||||
/** | /** | |||
* Sets the callback to be used when calling instances created from | * Sets the callback to be used when calling instances created from | |||
* this template as a function. If no callback is set, instances | * this template as a function. If no callback is set, instances | |||
* behave like normal JavaScript objects that cannot be called as a | * behave like normal JavaScript objects that cannot be called as a | |||
* function. | * function. | |||
*/ | */ | |||
void SetCallAsFunctionHandler(InvocationCallback callback, | void SetCallAsFunctionHandler(InvocationCallback callback, | |||
Handle<Value> data = Handle<Value>()); | Handle<Value> data = Handle<Value>()); | |||
End of changes. 5 change blocks. | ||||
47 lines changed or deleted | 3 lines changed or added | |||