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 4766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4777 * \param data A piece of data that will be passed to the callbacks | 4777 * \param data A piece of data that will be passed to the callbacks |
4778 * whenever they are invoked. | 4778 * whenever they are invoked. |
4779 */ | 4779 */ |
4780 // TODO(dcarney): deprecate | 4780 // TODO(dcarney): deprecate |
4781 void SetNamedPropertyHandler(NamedPropertyGetterCallback getter, | 4781 void SetNamedPropertyHandler(NamedPropertyGetterCallback getter, |
4782 NamedPropertySetterCallback setter = 0, | 4782 NamedPropertySetterCallback setter = 0, |
4783 NamedPropertyQueryCallback query = 0, | 4783 NamedPropertyQueryCallback query = 0, |
4784 NamedPropertyDeleterCallback deleter = 0, | 4784 NamedPropertyDeleterCallback deleter = 0, |
4785 NamedPropertyEnumeratorCallback enumerator = 0, | 4785 NamedPropertyEnumeratorCallback enumerator = 0, |
4786 Local<Value> data = Local<Value>()); | 4786 Local<Value> data = Local<Value>()); |
| 4787 |
| 4788 /** |
| 4789 * Sets a named property handler on the object template. |
| 4790 * |
| 4791 * Whenever a property whose name is a string or a symbol is accessed on |
| 4792 * objects created from this object template, the provided callback is |
| 4793 * invoked instead of accessing the property directly on the JavaScript |
| 4794 * object. |
| 4795 * |
| 4796 * @param configuration The NamedPropertyHandlerConfiguration that defines the |
| 4797 * callbacks to invoke when accessing a property. |
| 4798 */ |
4787 void SetHandler(const NamedPropertyHandlerConfiguration& configuration); | 4799 void SetHandler(const NamedPropertyHandlerConfiguration& configuration); |
4788 | 4800 |
4789 /** | 4801 /** |
4790 * Sets an indexed property handler on the object template. | 4802 * Sets an indexed property handler on the object template. |
4791 * | 4803 * |
4792 * Whenever an indexed property is accessed on objects created from | 4804 * Whenever an indexed property is accessed on objects created from |
4793 * this object template, the provided callback is invoked instead of | 4805 * this object template, the provided callback is invoked instead of |
4794 * accessing the property directly on the JavaScript object. | 4806 * accessing the property directly on the JavaScript object. |
4795 * | 4807 * |
4796 * \param getter The callback to invoke when getting a property. | 4808 * \param getter The callback to invoke when getting a property. |
4797 * \param setter The callback to invoke when setting a property. | 4809 * \param setter The callback to invoke when setting a property. |
4798 * \param query The callback to invoke to check if an object has a property. | 4810 * \param query The callback to invoke to check if an object has a property. |
4799 * \param deleter The callback to invoke when deleting a property. | 4811 * \param deleter The callback to invoke when deleting a property. |
4800 * \param enumerator The callback to invoke to enumerate all the indexed | 4812 * \param enumerator The callback to invoke to enumerate all the indexed |
4801 * properties of an object. | 4813 * properties of an object. |
4802 * \param data A piece of data that will be passed to the callbacks | 4814 * \param data A piece of data that will be passed to the callbacks |
4803 * whenever they are invoked. | 4815 * whenever they are invoked. |
4804 */ | 4816 */ |
4805 // TODO(dcarney): deprecate | 4817 // TODO(dcarney): deprecate |
4806 void SetIndexedPropertyHandler( | 4818 void SetIndexedPropertyHandler( |
4807 IndexedPropertyGetterCallback getter, | 4819 IndexedPropertyGetterCallback getter, |
4808 IndexedPropertySetterCallback setter = 0, | 4820 IndexedPropertySetterCallback setter = 0, |
4809 IndexedPropertyQueryCallback query = 0, | 4821 IndexedPropertyQueryCallback query = 0, |
4810 IndexedPropertyDeleterCallback deleter = 0, | 4822 IndexedPropertyDeleterCallback deleter = 0, |
4811 IndexedPropertyEnumeratorCallback enumerator = 0, | 4823 IndexedPropertyEnumeratorCallback enumerator = 0, |
4812 Local<Value> data = Local<Value>()) { | 4824 Local<Value> data = Local<Value>()) { |
4813 SetHandler(IndexedPropertyHandlerConfiguration(getter, setter, query, | 4825 SetHandler(IndexedPropertyHandlerConfiguration(getter, setter, query, |
4814 deleter, enumerator, data)); | 4826 deleter, enumerator, data)); |
4815 } | 4827 } |
| 4828 |
| 4829 /** |
| 4830 * Sets an indexed property handler on the object template. |
| 4831 * |
| 4832 * Whenever an indexed property is accessed on objects created from |
| 4833 * this object template, the provided callback is invoked instead of |
| 4834 * accessing the property directly on the JavaScript object. |
| 4835 * |
| 4836 * @param configuration The IndexedPropertyHandlerConfiguration that defines |
| 4837 * the callbacks to invoke when accessing a property. |
| 4838 */ |
4816 void SetHandler(const IndexedPropertyHandlerConfiguration& configuration); | 4839 void SetHandler(const IndexedPropertyHandlerConfiguration& configuration); |
4817 | 4840 |
4818 /** | 4841 /** |
4819 * Sets the callback to be used when calling instances created from | 4842 * Sets the callback to be used when calling instances created from |
4820 * this template as a function. If no callback is set, instances | 4843 * this template as a function. If no callback is set, instances |
4821 * behave like normal JavaScript objects that cannot be called as a | 4844 * behave like normal JavaScript objects that cannot be called as a |
4822 * function. | 4845 * function. |
4823 */ | 4846 */ |
4824 void SetCallAsFunctionHandler(FunctionCallback callback, | 4847 void SetCallAsFunctionHandler(FunctionCallback callback, |
4825 Local<Value> data = Local<Value>()); | 4848 Local<Value> data = Local<Value>()); |
(...skipping 4163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8989 */ | 9012 */ |
8990 | 9013 |
8991 | 9014 |
8992 } // namespace v8 | 9015 } // namespace v8 |
8993 | 9016 |
8994 | 9017 |
8995 #undef TYPE_CHECK | 9018 #undef TYPE_CHECK |
8996 | 9019 |
8997 | 9020 |
8998 #endif // INCLUDE_V8_H_ | 9021 #endif // INCLUDE_V8_H_ |
OLD | NEW |