Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: include/v8.h

Issue 1407313004: Adds the possibility of setting a Code object as the callback of a FunctionTemplate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/execution.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_JS_ACCESSORS
4426 /** Creates a function template with a code object. */
4427 static Local<FunctionTemplate> New(
4428 Isolate* isolate, Local<Value> code,
4429 Local<Value> data = Local<Value>(),
4430 Local<Signature> signature = Local<Signature>(), int length = 0);
4431 #endif
4432
4425 /** Returns the unique function instance in the current execution context.*/ 4433 /** Returns the unique function instance in the current execution context.*/
4426 V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction()); 4434 V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction());
4427 V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction( 4435 V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
4428 Local<Context> context); 4436 Local<Context> context);
4429 4437
4430 /** 4438 /**
4431 * Set the call-handler callback for a FunctionTemplate. This 4439 * Set the call-handler callback for a FunctionTemplate. This
4432 * callback is called whenever the function created from this 4440 * callback is called whenever the function created from this
4433 * FunctionTemplate is called. 4441 * FunctionTemplate is called.
4434 */ 4442 */
4435 void SetCallHandler(FunctionCallback callback, 4443 void SetCallHandler(FunctionCallback callback,
4436 Local<Value> data = Local<Value>()); 4444 Local<Value> data = Local<Value>());
4445 #ifdef V8_JS_ACCESSORS
4446 void SetCallHandler(Local<Value> code,
4447 Local<Value> data = Local<Value>());
4448 #endif
4437 4449
4438 /** Set the predefined length property for the FunctionTemplate. */ 4450 /** Set the predefined length property for the FunctionTemplate. */
4439 void SetLength(int length); 4451 void SetLength(int length);
4440 4452
4441 /** Get the InstanceTemplate. */ 4453 /** Get the InstanceTemplate. */
4442 Local<ObjectTemplate> InstanceTemplate(); 4454 Local<ObjectTemplate> InstanceTemplate();
4443 4455
4444 /** Causes the function template to inherit from a parent function template.*/ 4456 /** Causes the function template to inherit from a parent function template.*/
4445 void Inherit(Local<FunctionTemplate> parent); 4457 void Inherit(Local<FunctionTemplate> parent);
4446 4458
(...skipping 4030 matching lines...) Expand 10 before | Expand all | Expand 10 after
8477 */ 8489 */
8478 8490
8479 8491
8480 } // namespace v8 8492 } // namespace v8
8481 8493
8482 8494
8483 #undef TYPE_CHECK 8495 #undef TYPE_CHECK
8484 8496
8485 8497
8486 #endif // V8_H_ 8498 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/execution.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698