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::SetNamedPropertyHandler. |
| 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3633 Handle<AccessorSignature> signature = | 3682 Handle<AccessorSignature> signature = |
3634 Handle<AccessorSignature>()); | 3683 Handle<AccessorSignature>()); |
3635 | 3684 |
3636 /** | 3685 /** |
3637 * Sets a named property handler on the object template. | 3686 * Sets a named property handler on the object template. |
3638 * | 3687 * |
3639 * Whenever a property whose name is a string is accessed on objects created | 3688 * Whenever a property whose name is a string is accessed on objects created |
3640 * from this object template, the provided callback is invoked instead of | 3689 * from this object template, the provided callback is invoked instead of |
3641 * accessing the property directly on the JavaScript object. | 3690 * accessing the property directly on the JavaScript object. |
3642 * | 3691 * |
| 3692 * Note that new code should use the second version that can intercept |
| 3693 * symbol-named properties as well as string-named properties. |
| 3694 * |
3643 * \param getter The callback to invoke when getting a property. | 3695 * \param getter The callback to invoke when getting a property. |
3644 * \param setter The callback to invoke when setting a property. | 3696 * \param setter The callback to invoke when setting a property. |
3645 * \param query The callback to invoke to check if a property is present, | 3697 * \param query The callback to invoke to check if a property is present, |
3646 * and if present, get its attributes. | 3698 * and if present, get its attributes. |
3647 * \param deleter The callback to invoke when deleting a property. | 3699 * \param deleter The callback to invoke when deleting a property. |
3648 * \param enumerator The callback to invoke to enumerate all the named | 3700 * \param enumerator The callback to invoke to enumerate all the named |
3649 * properties of an object. | 3701 * properties of an object. |
3650 * \param data A piece of data that will be passed to the callbacks | 3702 * \param data A piece of data that will be passed to the callbacks |
3651 * whenever they are invoked. | 3703 * whenever they are invoked. |
3652 */ | 3704 */ |
3653 void SetNamedPropertyHandler( | 3705 void SetNamedPropertyHandler( |
3654 NamedPropertyGetterCallback getter, | 3706 NamedPropertyGetterCallback getter, |
3655 NamedPropertySetterCallback setter = 0, | 3707 NamedPropertySetterCallback setter = 0, |
3656 NamedPropertyQueryCallback query = 0, | 3708 NamedPropertyQueryCallback query = 0, |
3657 NamedPropertyDeleterCallback deleter = 0, | 3709 NamedPropertyDeleterCallback deleter = 0, |
3658 NamedPropertyEnumeratorCallback enumerator = 0, | 3710 NamedPropertyEnumeratorCallback enumerator = 0, |
3659 Handle<Value> data = Handle<Value>()); | 3711 Handle<Value> data = Handle<Value>()); |
| 3712 void SetNamedPropertyHandler( |
| 3713 GenericNamedPropertyGetterCallback getter, |
| 3714 GenericNamedPropertySetterCallback setter = 0, |
| 3715 GenericNamedPropertyQueryCallback query = 0, |
| 3716 GenericNamedPropertyDeleterCallback deleter = 0, |
| 3717 GenericNamedPropertyEnumeratorCallback enumerator = 0, |
| 3718 Handle<Value> data = Handle<Value>()); |
3660 | 3719 |
3661 /** | 3720 /** |
3662 * Sets an indexed property handler on the object template. | 3721 * Sets an indexed property handler on the object template. |
3663 * | 3722 * |
3664 * Whenever an indexed property is accessed on objects created from | 3723 * Whenever an indexed property is accessed on objects created from |
3665 * this object template, the provided callback is invoked instead of | 3724 * this object template, the provided callback is invoked instead of |
3666 * accessing the property directly on the JavaScript object. | 3725 * accessing the property directly on the JavaScript object. |
3667 * | 3726 * |
3668 * \param getter The callback to invoke when getting a property. | 3727 * \param getter The callback to invoke when getting a property. |
3669 * \param setter The callback to invoke when setting a property. | 3728 * \param setter The callback to invoke when setting a property. |
(...skipping 3118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6788 */ | 6847 */ |
6789 | 6848 |
6790 | 6849 |
6791 } // namespace v8 | 6850 } // namespace v8 |
6792 | 6851 |
6793 | 6852 |
6794 #undef TYPE_CHECK | 6853 #undef TYPE_CHECK |
6795 | 6854 |
6796 | 6855 |
6797 #endif // V8_H_ | 6856 #endif // V8_H_ |
OLD | NEW |