| 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 3223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3234 static const int kDataIndex = 5; | 3234 static const int kDataIndex = 5; |
| 3235 static const int kThisIndex = 6; | 3235 static const int kThisIndex = 6; |
| 3236 | 3236 |
| 3237 V8_INLINE PropertyCallbackInfo(internal::Object** args) : args_(args) {} | 3237 V8_INLINE PropertyCallbackInfo(internal::Object** args) : args_(args) {} |
| 3238 internal::Object** args_; | 3238 internal::Object** args_; |
| 3239 }; | 3239 }; |
| 3240 | 3240 |
| 3241 | 3241 |
| 3242 typedef void (*FunctionCallback)(const FunctionCallbackInfo<Value>& info); | 3242 typedef void (*FunctionCallback)(const FunctionCallbackInfo<Value>& info); |
| 3243 | 3243 |
| 3244 enum class ConstructorBehavior { kThrow, kAllow }; |
| 3244 | 3245 |
| 3245 /** | 3246 /** |
| 3246 * A JavaScript function object (ECMA-262, 15.3). | 3247 * A JavaScript function object (ECMA-262, 15.3). |
| 3247 */ | 3248 */ |
| 3248 class V8_EXPORT Function : public Object { | 3249 class V8_EXPORT Function : public Object { |
| 3249 public: | 3250 public: |
| 3250 /** | 3251 /** |
| 3251 * Create a function in the current execution context | 3252 * Create a function in the current execution context |
| 3252 * for a given FunctionCallback. | 3253 * for a given FunctionCallback. |
| 3253 */ | 3254 */ |
| 3254 static MaybeLocal<Function> New(Local<Context> context, | 3255 static MaybeLocal<Function> New(Local<Context> context, |
| 3255 FunctionCallback callback, | 3256 FunctionCallback callback, |
| 3256 Local<Value> data = Local<Value>(), | 3257 Local<Value> data = Local<Value>(), |
| 3257 int length = 0); | 3258 int length = 0); |
| 3259 static MaybeLocal<Function> New(Local<Context> context, |
| 3260 FunctionCallback callback, |
| 3261 Local<Value> data, |
| 3262 int length, |
| 3263 ConstructorBehavior behavior); |
| 3258 static V8_DEPRECATE_SOON( | 3264 static V8_DEPRECATE_SOON( |
| 3259 "Use maybe version", | 3265 "Use maybe version", |
| 3260 Local<Function> New(Isolate* isolate, FunctionCallback callback, | 3266 Local<Function> New(Isolate* isolate, FunctionCallback callback, |
| 3261 Local<Value> data = Local<Value>(), int length = 0)); | 3267 Local<Value> data = Local<Value>(), int length = 0)); |
| 3262 | 3268 |
| 3263 V8_DEPRECATED("Use maybe version", | 3269 V8_DEPRECATED("Use maybe version", |
| 3264 Local<Object> NewInstance(int argc, Local<Value> argv[]) const); | 3270 Local<Object> NewInstance(int argc, Local<Value> argv[]) const); |
| 3265 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( | 3271 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( |
| 3266 Local<Context> context, int argc, Local<Value> argv[]) const; | 3272 Local<Context> context, int argc, Local<Value> argv[]) const; |
| 3267 | 3273 |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4471 * child_instance.instance_property == 3; | 4477 * child_instance.instance_property == 3; |
| 4472 * \endcode | 4478 * \endcode |
| 4473 */ | 4479 */ |
| 4474 class V8_EXPORT FunctionTemplate : public Template { | 4480 class V8_EXPORT FunctionTemplate : public Template { |
| 4475 public: | 4481 public: |
| 4476 /** Creates a function template.*/ | 4482 /** Creates a function template.*/ |
| 4477 static Local<FunctionTemplate> New( | 4483 static Local<FunctionTemplate> New( |
| 4478 Isolate* isolate, FunctionCallback callback = 0, | 4484 Isolate* isolate, FunctionCallback callback = 0, |
| 4479 Local<Value> data = Local<Value>(), | 4485 Local<Value> data = Local<Value>(), |
| 4480 Local<Signature> signature = Local<Signature>(), int length = 0); | 4486 Local<Signature> signature = Local<Signature>(), int length = 0); |
| 4487 static Local<FunctionTemplate> New( |
| 4488 Isolate* isolate, FunctionCallback callback, Local<Value> data, |
| 4489 Local<Signature> signature, int length, ConstructorBehavior behavior); |
| 4481 | 4490 |
| 4482 /** | 4491 /** |
| 4483 * Creates a function template with a fast handler. If a fast handler is set, | 4492 * Creates a function template with a fast handler. If a fast handler is set, |
| 4484 * the callback cannot be null. | 4493 * the callback cannot be null. |
| 4485 */ | 4494 */ |
| 4486 static Local<FunctionTemplate> NewWithFastHandler( | 4495 static Local<FunctionTemplate> NewWithFastHandler( |
| 4487 Isolate* isolate, FunctionCallback callback, | 4496 Isolate* isolate, FunctionCallback callback, |
| 4488 experimental::FastAccessorBuilder* fast_handler = nullptr, | 4497 experimental::FastAccessorBuilder* fast_handler = nullptr, |
| 4489 Local<Value> data = Local<Value>(), | 4498 Local<Value> data = Local<Value>(), |
| 4490 Local<Signature> signature = Local<Signature>(), int length = 0); | 4499 Local<Signature> signature = Local<Signature>(), int length = 0); |
| (...skipping 4283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8774 */ | 8783 */ |
| 8775 | 8784 |
| 8776 | 8785 |
| 8777 } // namespace v8 | 8786 } // namespace v8 |
| 8778 | 8787 |
| 8779 | 8788 |
| 8780 #undef TYPE_CHECK | 8789 #undef TYPE_CHECK |
| 8781 | 8790 |
| 8782 | 8791 |
| 8783 #endif // INCLUDE_V8_H_ | 8792 #endif // INCLUDE_V8_H_ |
| OLD | NEW |