Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/node/v8-function.h
$ cat -n /usr/include/node/v8-function.h 1 // Copyright 2021 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef INCLUDE_V8_FUNCTION_H_ 6 #define INCLUDE_V8_FUNCTION_H_ 7 8 #include
9 #include
10 11 #include "v8-function-callback.h" // NOLINT(build/include_directory) 12 #include "v8-local-handle.h" // NOLINT(build/include_directory) 13 #include "v8-message.h" // NOLINT(build/include_directory) 14 #include "v8-object.h" // NOLINT(build/include_directory) 15 #include "v8-template.h" // NOLINT(build/include_directory) 16 #include "v8config.h" // NOLINT(build/include_directory) 17 18 namespace v8 { 19 20 class Context; 21 class UnboundScript; 22 23 /** 24 * A JavaScript function object (ECMA-262, 15.3). 25 */ 26 class V8_EXPORT Function : public Object { 27 public: 28 /** 29 * Create a function in the current execution context 30 * for a given FunctionCallback. 31 */ 32 static MaybeLocal
New( 33 Local
context, FunctionCallback callback, 34 Local
data = Local
(), int length = 0, 35 ConstructorBehavior behavior = ConstructorBehavior::kAllow, 36 SideEffectType side_effect_type = SideEffectType::kHasSideEffect); 37 38 V8_WARN_UNUSED_RESULT MaybeLocal
NewInstance( 39 Local
context, int argc, Local
argv[]) const; 40 41 V8_WARN_UNUSED_RESULT MaybeLocal
NewInstance( 42 Local
context) const { 43 return NewInstance(context, 0, nullptr); 44 } 45 46 /** 47 * When side effect checks are enabled, passing kHasNoSideEffect allows the 48 * constructor to be invoked without throwing. Calls made within the 49 * constructor are still checked. 50 */ 51 V8_WARN_UNUSED_RESULT MaybeLocal
NewInstanceWithSideEffectType( 52 Local
context, int argc, Local
argv[], 53 SideEffectType side_effect_type = SideEffectType::kHasSideEffect) const; 54 55 V8_WARN_UNUSED_RESULT MaybeLocal
Call(Local
context, 56 Local
recv, int argc, 57 Local
argv[]); 58 59 void SetName(Local
name); 60 Local
GetName() const; 61 62 MaybeLocal
GetUnboundScript() const; 63 64 /** 65 * Name inferred from variable or property assignment of this function. 66 * Used to facilitate debugging and profiling of JavaScript code written 67 * in an OO style, where many functions are anonymous but are assigned 68 * to object properties. 69 */ 70 Local
GetInferredName() const; 71 72 /** 73 * displayName if it is set, otherwise name if it is configured, otherwise 74 * function name, otherwise inferred name. 75 */ 76 Local
GetDebugName() const; 77 78 /** 79 * Returns zero based line number of function body and 80 * kLineOffsetNotFound if no information available. 81 */ 82 int GetScriptLineNumber() const; 83 /** 84 * Returns zero based column number of function body and 85 * kLineOffsetNotFound if no information available. 86 */ 87 int GetScriptColumnNumber() const; 88 89 /** 90 * Returns scriptId. 91 */ 92 int ScriptId() const; 93 94 /** 95 * Returns the original function if this function is bound, else returns 96 * v8::Undefined. 97 */ 98 Local
GetBoundFunction() const; 99 100 /** 101 * Calls builtin Function.prototype.toString on this function. 102 * This is different from Value::ToString() that may call a user-defined 103 * toString() function, and different than Object::ObjectProtoToString() which 104 * always serializes "[object Function]". 105 */ 106 V8_WARN_UNUSED_RESULT MaybeLocal
FunctionProtoToString( 107 Local
context); 108 109 ScriptOrigin GetScriptOrigin() const; 110 V8_INLINE static Function* Cast(Value* value) { 111 #ifdef V8_ENABLE_CHECKS 112 CheckCast(value); 113 #endif 114 return static_cast
(value); 115 } 116 117 static const int kLineOffsetNotFound; 118 119 private: 120 Function(); 121 static void CheckCast(Value* obj); 122 }; 123 } // namespace v8 124 125 #endif // INCLUDE_V8_FUNCTION_H_
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™