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 4404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4415 * \endcode | 4415 * \endcode |
4416 */ | 4416 */ |
4417 class V8_EXPORT FunctionTemplate : public Template { | 4417 class V8_EXPORT FunctionTemplate : public Template { |
4418 public: | 4418 public: |
4419 /** Creates a function template.*/ | 4419 /** Creates a function template.*/ |
4420 static Local<FunctionTemplate> New( | 4420 static Local<FunctionTemplate> New( |
4421 Isolate* isolate, FunctionCallback callback = 0, | 4421 Isolate* isolate, FunctionCallback callback = 0, |
4422 Local<Value> data = Local<Value>(), | 4422 Local<Value> data = Local<Value>(), |
4423 Local<Signature> signature = Local<Signature>(), int length = 0); | 4423 Local<Signature> signature = Local<Signature>(), int length = 0); |
4424 | 4424 |
| 4425 #ifdef V8_FAST_ACCESSORS |
| 4426 /** Creates a function template with a code object. */ |
| 4427 static Local<FunctionTemplate> New( |
| 4428 Isolate* isolate, Local<Value> code, Local<Value> data = Local<Value>(), |
| 4429 Local<Signature> signature = Local<Signature>(), int length = 0); |
| 4430 #endif |
| 4431 |
4425 /** Returns the unique function instance in the current execution context.*/ | 4432 /** Returns the unique function instance in the current execution context.*/ |
4426 V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction()); | 4433 V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction()); |
4427 V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction( | 4434 V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction( |
4428 Local<Context> context); | 4435 Local<Context> context); |
4429 | 4436 |
4430 /** | 4437 /** |
4431 * Set the call-handler callback for a FunctionTemplate. This | 4438 * Set the call-handler callback for a FunctionTemplate. This |
4432 * callback is called whenever the function created from this | 4439 * callback is called whenever the function created from this |
4433 * FunctionTemplate is called. | 4440 * FunctionTemplate is called. |
4434 */ | 4441 */ |
4435 void SetCallHandler(FunctionCallback callback, | 4442 void SetCallHandler(FunctionCallback callback, |
4436 Local<Value> data = Local<Value>()); | 4443 Local<Value> data = Local<Value>()); |
| 4444 #ifdef V8_FAST_ACCESSORS |
| 4445 void SetCallHandler(Local<Value> code, Local<Value> data = Local<Value>()); |
| 4446 #endif |
4437 | 4447 |
4438 /** Set the predefined length property for the FunctionTemplate. */ | 4448 /** Set the predefined length property for the FunctionTemplate. */ |
4439 void SetLength(int length); | 4449 void SetLength(int length); |
4440 | 4450 |
4441 /** Get the InstanceTemplate. */ | 4451 /** Get the InstanceTemplate. */ |
4442 Local<ObjectTemplate> InstanceTemplate(); | 4452 Local<ObjectTemplate> InstanceTemplate(); |
4443 | 4453 |
4444 /** Causes the function template to inherit from a parent function template.*/ | 4454 /** Causes the function template to inherit from a parent function template.*/ |
4445 void Inherit(Local<FunctionTemplate> parent); | 4455 void Inherit(Local<FunctionTemplate> parent); |
4446 | 4456 |
(...skipping 4030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8477 */ | 8487 */ |
8478 | 8488 |
8479 | 8489 |
8480 } // namespace v8 | 8490 } // namespace v8 |
8481 | 8491 |
8482 | 8492 |
8483 #undef TYPE_CHECK | 8493 #undef TYPE_CHECK |
8484 | 8494 |
8485 | 8495 |
8486 #endif // V8_H_ | 8496 #endif // V8_H_ |
OLD | NEW |