OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2295 * child_instance.instance_accessor calls 'InstanceAccessorCallback' | 2295 * child_instance.instance_accessor calls 'InstanceAccessorCallback' |
2296 * child_instance.instance_property == 3; | 2296 * child_instance.instance_property == 3; |
2297 * \endcode | 2297 * \endcode |
2298 */ | 2298 */ |
2299 class V8EXPORT FunctionTemplate : public Template { | 2299 class V8EXPORT FunctionTemplate : public Template { |
2300 public: | 2300 public: |
2301 /** Creates a function template.*/ | 2301 /** Creates a function template.*/ |
2302 static Local<FunctionTemplate> New( | 2302 static Local<FunctionTemplate> New( |
2303 InvocationCallback callback = 0, | 2303 InvocationCallback callback = 0, |
2304 Handle<Value> data = Handle<Value>(), | 2304 Handle<Value> data = Handle<Value>(), |
2305 Handle<Signature> signature = Handle<Signature>()); | 2305 Handle<Signature> signature = Handle<Signature>(), |
| 2306 int length = 0); |
2306 /** Returns the unique function instance in the current execution context.*/ | 2307 /** Returns the unique function instance in the current execution context.*/ |
2307 Local<Function> GetFunction(); | 2308 Local<Function> GetFunction(); |
2308 | 2309 |
2309 /** | 2310 /** |
2310 * Set the call-handler callback for a FunctionTemplate. This | 2311 * Set the call-handler callback for a FunctionTemplate. This |
2311 * callback is called whenever the function created from this | 2312 * callback is called whenever the function created from this |
2312 * FunctionTemplate is called. | 2313 * FunctionTemplate is called. |
2313 */ | 2314 */ |
2314 void SetCallHandler(InvocationCallback callback, | 2315 void SetCallHandler(InvocationCallback callback, |
2315 Handle<Value> data = Handle<Value>()); | 2316 Handle<Value> data = Handle<Value>()); |
2316 | 2317 |
| 2318 /** Set the predefined length property for the FunctionTemplate. */ |
| 2319 void SetLength(int length); |
| 2320 |
2317 /** Get the InstanceTemplate. */ | 2321 /** Get the InstanceTemplate. */ |
2318 Local<ObjectTemplate> InstanceTemplate(); | 2322 Local<ObjectTemplate> InstanceTemplate(); |
2319 | 2323 |
2320 /** Causes the function template to inherit from a parent function template.*/ | 2324 /** Causes the function template to inherit from a parent function template.*/ |
2321 void Inherit(Handle<FunctionTemplate> parent); | 2325 void Inherit(Handle<FunctionTemplate> parent); |
2322 | 2326 |
2323 /** | 2327 /** |
2324 * A PrototypeTemplate is the template used to create the prototype object | 2328 * A PrototypeTemplate is the template used to create the prototype object |
2325 * of the function created by this template. | 2329 * of the function created by this template. |
2326 */ | 2330 */ |
2327 Local<ObjectTemplate> PrototypeTemplate(); | 2331 Local<ObjectTemplate> PrototypeTemplate(); |
2328 | 2332 |
2329 | |
2330 /** | 2333 /** |
2331 * Set the class name of the FunctionTemplate. This is used for | 2334 * Set the class name of the FunctionTemplate. This is used for |
2332 * printing objects created with the function created from the | 2335 * printing objects created with the function created from the |
2333 * FunctionTemplate as its constructor. | 2336 * FunctionTemplate as its constructor. |
2334 */ | 2337 */ |
2335 void SetClassName(Handle<String> name); | 2338 void SetClassName(Handle<String> name); |
2336 | 2339 |
2337 /** | 2340 /** |
2338 * Determines whether the __proto__ accessor ignores instances of | 2341 * Determines whether the __proto__ accessor ignores instances of |
2339 * the function template. If instances of the function template are | 2342 * the function template. If instances of the function template are |
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4859 | 4862 |
4860 | 4863 |
4861 } // namespace v8 | 4864 } // namespace v8 |
4862 | 4865 |
4863 | 4866 |
4864 #undef V8EXPORT | 4867 #undef V8EXPORT |
4865 #undef TYPE_CHECK | 4868 #undef TYPE_CHECK |
4866 | 4869 |
4867 | 4870 |
4868 #endif // V8_H_ | 4871 #endif // V8_H_ |
OLD | NEW |