OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 3301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3312 | 3312 |
3313 | 3313 |
3314 /** | 3314 /** |
3315 * Returns an array containing the names of the properties the named | 3315 * Returns an array containing the names of the properties the named |
3316 * property getter intercepts. | 3316 * property getter intercepts. |
3317 */ | 3317 */ |
3318 typedef void (*NamedPropertyEnumeratorCallback)( | 3318 typedef void (*NamedPropertyEnumeratorCallback)( |
3319 const PropertyCallbackInfo<Array>& info); | 3319 const PropertyCallbackInfo<Array>& info); |
3320 | 3320 |
3321 | 3321 |
3322 // TODO(wingo): Deprecate and remove previous typedefs, and replace | |
3323 // GenericNamedPropertyFooCallback with just NamedPropertyFooCallback. | |
3324 /** | |
3325 * GenericNamedProperty[Getter|Setter] are used as interceptors on object. | |
3326 * See ObjectTemplate::SetGenericNamedPropertyHandler. | |
3327 */ | |
3328 typedef void (*GenericNamedPropertyGetterCallback)( | |
3329 Local<Name> property, | |
3330 const PropertyCallbackInfo<Value>& info); | |
3331 | |
3332 | |
3333 /** | |
3334 * Returns the value if the setter intercepts the request. | |
3335 * Otherwise, returns an empty handle. | |
3336 */ | |
3337 typedef void (*GenericNamedPropertySetterCallback)( | |
3338 Local<Name> property, | |
3339 Local<Value> value, | |
3340 const PropertyCallbackInfo<Value>& info); | |
3341 | |
3342 | |
3343 /** | |
3344 * Returns a non-empty handle if the interceptor intercepts the request. | |
3345 * The result is an integer encoding property attributes (like v8::None, | |
3346 * v8::DontEnum, etc.) | |
3347 */ | |
3348 typedef void (*GenericNamedPropertyQueryCallback)( | |
3349 Local<Name> property, | |
3350 const PropertyCallbackInfo<Integer>& info); | |
3351 | |
3352 | |
3353 /** | |
3354 * Returns a non-empty handle if the deleter intercepts the request. | |
3355 * The return value is true if the property could be deleted and false | |
3356 * otherwise. | |
3357 */ | |
3358 typedef void (*GenericNamedPropertyDeleterCallback)( | |
3359 Local<Name> property, | |
3360 const PropertyCallbackInfo<Boolean>& info); | |
3361 | |
3362 | |
3363 /** | |
3364 * Returns an array containing the names of the properties the named | |
3365 * property getter intercepts. | |
3366 */ | |
3367 typedef void (*GenericNamedPropertyEnumeratorCallback)( | |
3368 const PropertyCallbackInfo<Array>& info); | |
3369 | |
3370 | |
3322 /** | 3371 /** |
3323 * Returns the value of the property if the getter intercepts the | 3372 * Returns the value of the property if the getter intercepts the |
3324 * request. Otherwise, returns an empty handle. | 3373 * request. Otherwise, returns an empty handle. |
3325 */ | 3374 */ |
3326 typedef void (*IndexedPropertyGetterCallback)( | 3375 typedef void (*IndexedPropertyGetterCallback)( |
3327 uint32_t index, | 3376 uint32_t index, |
3328 const PropertyCallbackInfo<Value>& info); | 3377 const PropertyCallbackInfo<Value>& info); |
3329 | 3378 |
3330 | 3379 |
3331 /** | 3380 /** |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3652 */ | 3701 */ |
3653 void SetNamedPropertyHandler( | 3702 void SetNamedPropertyHandler( |
3654 NamedPropertyGetterCallback getter, | 3703 NamedPropertyGetterCallback getter, |
3655 NamedPropertySetterCallback setter = 0, | 3704 NamedPropertySetterCallback setter = 0, |
3656 NamedPropertyQueryCallback query = 0, | 3705 NamedPropertyQueryCallback query = 0, |
3657 NamedPropertyDeleterCallback deleter = 0, | 3706 NamedPropertyDeleterCallback deleter = 0, |
3658 NamedPropertyEnumeratorCallback enumerator = 0, | 3707 NamedPropertyEnumeratorCallback enumerator = 0, |
3659 Handle<Value> data = Handle<Value>()); | 3708 Handle<Value> data = Handle<Value>()); |
3660 | 3709 |
3661 /** | 3710 /** |
3711 * Sets a named property handler on the object template. | |
3712 * | |
3713 * Whenever a property is accessed on objects created from this object | |
3714 * template, the provided callback is invoked instead of accessing the | |
3715 * property directly on the JavaScript object. | |
3716 * | |
3717 * Unlike SetNamedPropertyHandler, this version also intercepts values whose | |
3718 * names are symbols. | |
3719 * | |
3720 * \param getter The callback to invoke when getting a property. | |
3721 * \param setter The callback to invoke when setting a property. | |
3722 * \param query The callback to invoke to check if a property is present, | |
3723 * and if present, get its attributes. | |
3724 * \param deleter The callback to invoke when deleting a property. | |
3725 * \param enumerator The callback to invoke to enumerate all the named | |
3726 * properties of an object. | |
3727 * \param data A piece of data that will be passed to the callbacks | |
3728 * whenever they are invoked. | |
3729 */ | |
3730 void SetGenericNamedPropertyHandler( | |
dcarney
2014/08/13 08:25:39
should be SetNamedPropertyHandler. easier to get r
wingo
2014/08/13 10:45:39
Alack, I just did this, but:
../test/cctest/test-
dcarney
2014/08/13 11:19:56
i didn't even know this was supported. since it's
| |
3731 GenericNamedPropertyGetterCallback getter, | |
3732 GenericNamedPropertySetterCallback setter = 0, | |
3733 GenericNamedPropertyQueryCallback query = 0, | |
3734 GenericNamedPropertyDeleterCallback deleter = 0, | |
3735 GenericNamedPropertyEnumeratorCallback enumerator = 0, | |
3736 Handle<Value> data = Handle<Value>()); | |
3737 | |
3738 /** | |
3662 * Sets an indexed property handler on the object template. | 3739 * Sets an indexed property handler on the object template. |
3663 * | 3740 * |
3664 * Whenever an indexed property is accessed on objects created from | 3741 * Whenever an indexed property is accessed on objects created from |
3665 * this object template, the provided callback is invoked instead of | 3742 * this object template, the provided callback is invoked instead of |
3666 * accessing the property directly on the JavaScript object. | 3743 * accessing the property directly on the JavaScript object. |
3667 * | 3744 * |
3668 * \param getter The callback to invoke when getting a property. | 3745 * \param getter The callback to invoke when getting a property. |
3669 * \param setter The callback to invoke when setting a property. | 3746 * \param setter The callback to invoke when setting a property. |
3670 * \param query The callback to invoke to check if an object has a property. | 3747 * \param query The callback to invoke to check if an object has a property. |
3671 * \param deleter The callback to invoke when deleting a property. | 3748 * \param deleter The callback to invoke when deleting a property. |
(...skipping 3116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6788 */ | 6865 */ |
6789 | 6866 |
6790 | 6867 |
6791 } // namespace v8 | 6868 } // namespace v8 |
6792 | 6869 |
6793 | 6870 |
6794 #undef TYPE_CHECK | 6871 #undef TYPE_CHECK |
6795 | 6872 |
6796 | 6873 |
6797 #endif // V8_H_ | 6874 #endif // V8_H_ |
OLD | NEW |