| 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 4469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4480 * \endcode | 4480 * \endcode |
| 4481 */ | 4481 */ |
| 4482 class V8_EXPORT FunctionTemplate : public Template { | 4482 class V8_EXPORT FunctionTemplate : public Template { |
| 4483 public: | 4483 public: |
| 4484 /** Creates a function template.*/ | 4484 /** Creates a function template.*/ |
| 4485 static Local<FunctionTemplate> New( | 4485 static Local<FunctionTemplate> New( |
| 4486 Isolate* isolate, FunctionCallback callback = 0, | 4486 Isolate* isolate, FunctionCallback callback = 0, |
| 4487 Local<Value> data = Local<Value>(), | 4487 Local<Value> data = Local<Value>(), |
| 4488 Local<Signature> signature = Local<Signature>(), int length = 0); | 4488 Local<Signature> signature = Local<Signature>(), int length = 0); |
| 4489 | 4489 |
| 4490 /** Get a template included in the snapshot by index. */ |
| 4491 static Local<FunctionTemplate> FromSnapshot(Isolate* isolate, size_t index); |
| 4492 |
| 4490 /** | 4493 /** |
| 4491 * Creates a function template with a fast handler. If a fast handler is set, | 4494 * Creates a function template with a fast handler. If a fast handler is set, |
| 4492 * the callback cannot be null. | 4495 * the callback cannot be null. |
| 4493 */ | 4496 */ |
| 4494 static Local<FunctionTemplate> NewWithFastHandler( | 4497 static Local<FunctionTemplate> NewWithFastHandler( |
| 4495 Isolate* isolate, FunctionCallback callback, | 4498 Isolate* isolate, FunctionCallback callback, |
| 4496 experimental::FastAccessorBuilder* fast_handler = nullptr, | 4499 experimental::FastAccessorBuilder* fast_handler = nullptr, |
| 4497 Local<Value> data = Local<Value>(), | 4500 Local<Value> data = Local<Value>(), |
| 4498 Local<Signature> signature = Local<Signature>(), int length = 0); | 4501 Local<Signature> signature = Local<Signature>(), int length = 0); |
| 4499 | 4502 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4655 * created from the ObjectTemplate. | 4658 * created from the ObjectTemplate. |
| 4656 */ | 4659 */ |
| 4657 class V8_EXPORT ObjectTemplate : public Template { | 4660 class V8_EXPORT ObjectTemplate : public Template { |
| 4658 public: | 4661 public: |
| 4659 /** Creates an ObjectTemplate. */ | 4662 /** Creates an ObjectTemplate. */ |
| 4660 static Local<ObjectTemplate> New( | 4663 static Local<ObjectTemplate> New( |
| 4661 Isolate* isolate, | 4664 Isolate* isolate, |
| 4662 Local<FunctionTemplate> constructor = Local<FunctionTemplate>()); | 4665 Local<FunctionTemplate> constructor = Local<FunctionTemplate>()); |
| 4663 static V8_DEPRECATED("Use isolate version", Local<ObjectTemplate> New()); | 4666 static V8_DEPRECATED("Use isolate version", Local<ObjectTemplate> New()); |
| 4664 | 4667 |
| 4668 /** Get a template included in the snapshot by index. */ |
| 4669 static Local<ObjectTemplate> FromSnapshot(Isolate* isolate, size_t index); |
| 4670 |
| 4665 /** Creates a new instance of this template.*/ | 4671 /** Creates a new instance of this template.*/ |
| 4666 V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance()); | 4672 V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance()); |
| 4667 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context); | 4673 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context); |
| 4668 | 4674 |
| 4669 /** | 4675 /** |
| 4670 * Sets an accessor on the object template. | 4676 * Sets an accessor on the object template. |
| 4671 * | 4677 * |
| 4672 * Whenever the property with the given name is accessed on objects | 4678 * Whenever the property with the given name is accessed on objects |
| 4673 * created from this ObjectTemplate the getter and setter callbacks | 4679 * created from this ObjectTemplate the getter and setter callbacks |
| 4674 * are called instead of getting and setting the property directly | 4680 * are called instead of getting and setting the property directly |
| (...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6804 */ | 6810 */ |
| 6805 Isolate* GetIsolate(); | 6811 Isolate* GetIsolate(); |
| 6806 | 6812 |
| 6807 /** | 6813 /** |
| 6808 * Add a context to be included in the snapshot blob. | 6814 * Add a context to be included in the snapshot blob. |
| 6809 * \returns the index of the context in the snapshot blob. | 6815 * \returns the index of the context in the snapshot blob. |
| 6810 */ | 6816 */ |
| 6811 size_t AddContext(Local<Context> context); | 6817 size_t AddContext(Local<Context> context); |
| 6812 | 6818 |
| 6813 /** | 6819 /** |
| 6820 * Add a template to be included in the snapshot blob. |
| 6821 * \returns the index of the template in the snapshot blob. |
| 6822 */ |
| 6823 size_t AddTemplate(Local<Template> template_obj); |
| 6824 |
| 6825 /** |
| 6814 * Created a snapshot data blob. | 6826 * Created a snapshot data blob. |
| 6815 * This must not be called from within a handle scope. | 6827 * This must not be called from within a handle scope. |
| 6816 * \param function_code_handling whether to include compiled function code | 6828 * \param function_code_handling whether to include compiled function code |
| 6817 * in the snapshot. | 6829 * in the snapshot. |
| 6818 * \returns { nullptr, 0 } on failure, and a startup snapshot on success. The | 6830 * \returns { nullptr, 0 } on failure, and a startup snapshot on success. The |
| 6819 * caller acquires ownership of the data array in the return value. | 6831 * caller acquires ownership of the data array in the return value. |
| 6820 */ | 6832 */ |
| 6821 StartupData CreateBlob(FunctionCodeHandling function_code_handling); | 6833 StartupData CreateBlob(FunctionCodeHandling function_code_handling); |
| 6822 | 6834 |
| 6823 private: | 6835 private: |
| (...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8873 */ | 8885 */ |
| 8874 | 8886 |
| 8875 | 8887 |
| 8876 } // namespace v8 | 8888 } // namespace v8 |
| 8877 | 8889 |
| 8878 | 8890 |
| 8879 #undef TYPE_CHECK | 8891 #undef TYPE_CHECK |
| 8880 | 8892 |
| 8881 | 8893 |
| 8882 #endif // INCLUDE_V8_H_ | 8894 #endif // INCLUDE_V8_H_ |
| OLD | NEW |