| 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 4472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4483 */ | 4483 */ |
| 4484 class V8_EXPORT FunctionTemplate : public Template { | 4484 class V8_EXPORT FunctionTemplate : public Template { |
| 4485 public: | 4485 public: |
| 4486 /** Creates a function template.*/ | 4486 /** Creates a function template.*/ |
| 4487 static Local<FunctionTemplate> New( | 4487 static Local<FunctionTemplate> New( |
| 4488 Isolate* isolate, FunctionCallback callback = 0, | 4488 Isolate* isolate, FunctionCallback callback = 0, |
| 4489 Local<Value> data = Local<Value>(), | 4489 Local<Value> data = Local<Value>(), |
| 4490 Local<Signature> signature = Local<Signature>(), int length = 0); | 4490 Local<Signature> signature = Local<Signature>(), int length = 0); |
| 4491 | 4491 |
| 4492 /** Get a template included in the snapshot by index. */ | 4492 /** Get a template included in the snapshot by index. */ |
| 4493 static Local<FunctionTemplate> FromSnapshot(Isolate* isolate, size_t index); | 4493 static MaybeLocal<FunctionTemplate> FromSnapshot(Isolate* isolate, |
| 4494 size_t index); |
| 4494 | 4495 |
| 4495 /** | 4496 /** |
| 4496 * Creates a function template with a fast handler. If a fast handler is set, | 4497 * Creates a function template with a fast handler. If a fast handler is set, |
| 4497 * the callback cannot be null. | 4498 * the callback cannot be null. |
| 4498 */ | 4499 */ |
| 4499 static Local<FunctionTemplate> NewWithFastHandler( | 4500 static Local<FunctionTemplate> NewWithFastHandler( |
| 4500 Isolate* isolate, FunctionCallback callback, | 4501 Isolate* isolate, FunctionCallback callback, |
| 4501 experimental::FastAccessorBuilder* fast_handler = nullptr, | 4502 experimental::FastAccessorBuilder* fast_handler = nullptr, |
| 4502 Local<Value> data = Local<Value>(), | 4503 Local<Value> data = Local<Value>(), |
| 4503 Local<Signature> signature = Local<Signature>(), int length = 0); | 4504 Local<Signature> signature = Local<Signature>(), int length = 0); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4661 */ | 4662 */ |
| 4662 class V8_EXPORT ObjectTemplate : public Template { | 4663 class V8_EXPORT ObjectTemplate : public Template { |
| 4663 public: | 4664 public: |
| 4664 /** Creates an ObjectTemplate. */ | 4665 /** Creates an ObjectTemplate. */ |
| 4665 static Local<ObjectTemplate> New( | 4666 static Local<ObjectTemplate> New( |
| 4666 Isolate* isolate, | 4667 Isolate* isolate, |
| 4667 Local<FunctionTemplate> constructor = Local<FunctionTemplate>()); | 4668 Local<FunctionTemplate> constructor = Local<FunctionTemplate>()); |
| 4668 static V8_DEPRECATED("Use isolate version", Local<ObjectTemplate> New()); | 4669 static V8_DEPRECATED("Use isolate version", Local<ObjectTemplate> New()); |
| 4669 | 4670 |
| 4670 /** Get a template included in the snapshot by index. */ | 4671 /** Get a template included in the snapshot by index. */ |
| 4671 static Local<ObjectTemplate> FromSnapshot(Isolate* isolate, size_t index); | 4672 static MaybeLocal<ObjectTemplate> FromSnapshot(Isolate* isolate, |
| 4673 size_t index); |
| 4672 | 4674 |
| 4673 /** Creates a new instance of this template.*/ | 4675 /** Creates a new instance of this template.*/ |
| 4674 V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance()); | 4676 V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance()); |
| 4675 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context); | 4677 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context); |
| 4676 | 4678 |
| 4677 /** | 4679 /** |
| 4678 * Sets an accessor on the object template. | 4680 * Sets an accessor on the object template. |
| 4679 * | 4681 * |
| 4680 * Whenever the property with the given name is accessed on objects | 4682 * Whenever the property with the given name is accessed on objects |
| 4681 * created from this ObjectTemplate the getter and setter callbacks | 4683 * created from this ObjectTemplate the getter and setter callbacks |
| (...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7121 * | 7123 * |
| 7122 * \param global_object An optional global object to be reused for | 7124 * \param global_object An optional global object to be reused for |
| 7123 * the newly created context. This global object must have been | 7125 * the newly created context. This global object must have been |
| 7124 * created by a previous call to Context::New with the same global | 7126 * created by a previous call to Context::New with the same global |
| 7125 * template. The state of the global object will be completely reset | 7127 * template. The state of the global object will be completely reset |
| 7126 * and only object identify will remain. | 7128 * and only object identify will remain. |
| 7127 */ | 7129 */ |
| 7128 static Local<Context> New( | 7130 static Local<Context> New( |
| 7129 Isolate* isolate, ExtensionConfiguration* extensions = NULL, | 7131 Isolate* isolate, ExtensionConfiguration* extensions = NULL, |
| 7130 Local<ObjectTemplate> global_template = Local<ObjectTemplate>(), | 7132 Local<ObjectTemplate> global_template = Local<ObjectTemplate>(), |
| 7131 Local<Value> global_object = Local<Value>(), | 7133 Local<Value> global_object = Local<Value>()); |
| 7132 size_t context_snapshot_index = 0); | 7134 |
| 7135 static MaybeLocal<Context> FromSnapshot( |
| 7136 Isolate* isolate, size_t context_snapshot_index, |
| 7137 ExtensionConfiguration* extensions = NULL, |
| 7138 Local<ObjectTemplate> global_template = Local<ObjectTemplate>(), |
| 7139 Local<Value> global_object = Local<Value>()); |
| 7133 | 7140 |
| 7134 /** | 7141 /** |
| 7135 * Sets the security token for the context. To access an object in | 7142 * Sets the security token for the context. To access an object in |
| 7136 * another context, the security tokens must match. | 7143 * another context, the security tokens must match. |
| 7137 */ | 7144 */ |
| 7138 void SetSecurityToken(Local<Value> token); | 7145 void SetSecurityToken(Local<Value> token); |
| 7139 | 7146 |
| 7140 /** Restores the security token to the default value. */ | 7147 /** Restores the security token to the default value. */ |
| 7141 void UseDefaultSecurityToken(); | 7148 void UseDefaultSecurityToken(); |
| 7142 | 7149 |
| (...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8878 */ | 8885 */ |
| 8879 | 8886 |
| 8880 | 8887 |
| 8881 } // namespace v8 | 8888 } // namespace v8 |
| 8882 | 8889 |
| 8883 | 8890 |
| 8884 #undef TYPE_CHECK | 8891 #undef TYPE_CHECK |
| 8885 | 8892 |
| 8886 | 8893 |
| 8887 #endif // INCLUDE_V8_H_ | 8894 #endif // INCLUDE_V8_H_ |
| OLD | NEW |