| 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 3222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3233 static const int kDataIndex = 5; | 3233 static const int kDataIndex = 5; |
| 3234 static const int kThisIndex = 6; | 3234 static const int kThisIndex = 6; |
| 3235 | 3235 |
| 3236 V8_INLINE PropertyCallbackInfo(internal::Object** args) : args_(args) {} | 3236 V8_INLINE PropertyCallbackInfo(internal::Object** args) : args_(args) {} |
| 3237 internal::Object** args_; | 3237 internal::Object** args_; |
| 3238 }; | 3238 }; |
| 3239 | 3239 |
| 3240 | 3240 |
| 3241 typedef void (*FunctionCallback)(const FunctionCallbackInfo<Value>& info); | 3241 typedef void (*FunctionCallback)(const FunctionCallbackInfo<Value>& info); |
| 3242 | 3242 |
| 3243 enum class ConstructorBehavior { kThrow, kAllow }; |
| 3243 | 3244 |
| 3244 /** | 3245 /** |
| 3245 * A JavaScript function object (ECMA-262, 15.3). | 3246 * A JavaScript function object (ECMA-262, 15.3). |
| 3246 */ | 3247 */ |
| 3247 class V8_EXPORT Function : public Object { | 3248 class V8_EXPORT Function : public Object { |
| 3248 public: | 3249 public: |
| 3249 /** | 3250 /** |
| 3250 * Create a function in the current execution context | 3251 * Create a function in the current execution context |
| 3251 * for a given FunctionCallback. | 3252 * for a given FunctionCallback. |
| 3252 */ | 3253 */ |
| 3253 static MaybeLocal<Function> New(Local<Context> context, | 3254 static MaybeLocal<Function> New( |
| 3254 FunctionCallback callback, | 3255 Local<Context> context, FunctionCallback callback, |
| 3255 Local<Value> data = Local<Value>(), | 3256 Local<Value> data = Local<Value>(), int length = 0, |
| 3256 int length = 0); | 3257 ConstructorBehavior behavior = ConstructorBehavior::kAllow); |
| 3257 static V8_DEPRECATE_SOON( | 3258 static V8_DEPRECATE_SOON( |
| 3258 "Use maybe version", | 3259 "Use maybe version", |
| 3259 Local<Function> New(Isolate* isolate, FunctionCallback callback, | 3260 Local<Function> New(Isolate* isolate, FunctionCallback callback, |
| 3260 Local<Value> data = Local<Value>(), int length = 0)); | 3261 Local<Value> data = Local<Value>(), int length = 0)); |
| 3261 | 3262 |
| 3262 V8_DEPRECATED("Use maybe version", | 3263 V8_DEPRECATED("Use maybe version", |
| 3263 Local<Object> NewInstance(int argc, Local<Value> argv[]) const); | 3264 Local<Object> NewInstance(int argc, Local<Value> argv[]) const); |
| 3264 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( | 3265 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( |
| 3265 Local<Context> context, int argc, Local<Value> argv[]) const; | 3266 Local<Context> context, int argc, Local<Value> argv[]) const; |
| 3266 | 3267 |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4483 * child_instance.instance_accessor calls 'InstanceAccessorCallback' | 4484 * child_instance.instance_accessor calls 'InstanceAccessorCallback' |
| 4484 * child_instance.instance_property == 3; | 4485 * child_instance.instance_property == 3; |
| 4485 * \endcode | 4486 * \endcode |
| 4486 */ | 4487 */ |
| 4487 class V8_EXPORT FunctionTemplate : public Template { | 4488 class V8_EXPORT FunctionTemplate : public Template { |
| 4488 public: | 4489 public: |
| 4489 /** Creates a function template.*/ | 4490 /** Creates a function template.*/ |
| 4490 static Local<FunctionTemplate> New( | 4491 static Local<FunctionTemplate> New( |
| 4491 Isolate* isolate, FunctionCallback callback = 0, | 4492 Isolate* isolate, FunctionCallback callback = 0, |
| 4492 Local<Value> data = Local<Value>(), | 4493 Local<Value> data = Local<Value>(), |
| 4493 Local<Signature> signature = Local<Signature>(), int length = 0); | 4494 Local<Signature> signature = Local<Signature>(), int length = 0, |
| 4495 ConstructorBehavior behavior = ConstructorBehavior::kAllow); |
| 4494 | 4496 |
| 4495 /** | 4497 /** |
| 4496 * Creates a function template with a fast handler. If a fast handler is set, | 4498 * Creates a function template with a fast handler. If a fast handler is set, |
| 4497 * the callback cannot be null. | 4499 * the callback cannot be null. |
| 4498 */ | 4500 */ |
| 4499 static Local<FunctionTemplate> NewWithFastHandler( | 4501 static Local<FunctionTemplate> NewWithFastHandler( |
| 4500 Isolate* isolate, FunctionCallback callback, | 4502 Isolate* isolate, FunctionCallback callback, |
| 4501 experimental::FastAccessorBuilder* fast_handler = nullptr, | 4503 experimental::FastAccessorBuilder* fast_handler = nullptr, |
| 4502 Local<Value> data = Local<Value>(), | 4504 Local<Value> data = Local<Value>(), |
| 4503 Local<Signature> signature = Local<Signature>(), int length = 0); | 4505 Local<Signature> signature = Local<Signature>(), int length = 0); |
| (...skipping 4241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8745 */ | 8747 */ |
| 8746 | 8748 |
| 8747 | 8749 |
| 8748 } // namespace v8 | 8750 } // namespace v8 |
| 8749 | 8751 |
| 8750 | 8752 |
| 8751 #undef TYPE_CHECK | 8753 #undef TYPE_CHECK |
| 8752 | 8754 |
| 8753 | 8755 |
| 8754 #endif // INCLUDE_V8_H_ | 8756 #endif // INCLUDE_V8_H_ |
| OLD | NEW |