![]() |
v8 13.6.233 (node 24.1.0)
V8 is Google's open source JavaScript engine
|
#include <v8-function.h>
Static Public Member Functions | |
static MaybeLocal< Function > | New (Local< Context > context, FunctionCallback callback, Local< Value > data=Local< Value >(), int length=0, ConstructorBehavior behavior=ConstructorBehavior::kAllow, SideEffectType side_effect_type=SideEffectType::kHasSideEffect) |
static V8_INLINE Function * | Cast (Value *value) |
![]() | |
static V8_INLINE int | InternalFieldCount (const PersistentBase< Object > &object) |
static V8_INLINE int | InternalFieldCount (const BasicTracedReference< Object > &object) |
static V8_INLINE void * | GetAlignedPointerFromInternalField (const PersistentBase< Object > &object, int index) |
static V8_INLINE void * | GetAlignedPointerFromInternalField (const BasicTracedReference< Object > &object, int index) |
template<CppHeapPointerTag tag, typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper) |
template<CppHeapPointerTag tag, typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const PersistentBase< Object > &wrapper) |
template<CppHeapPointerTag tag, typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper) |
template<typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, CppHeapPointerTagRange tag_range) |
template<typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const PersistentBase< Object > &wrapper, CppHeapPointerTagRange tag_range) |
template<typename T = void> | |
static V8_INLINE T * | Unwrap (v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper, CppHeapPointerTagRange tag_range) |
template<CppHeapPointerTag tag> | |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, void *wrappable) |
template<CppHeapPointerTag tag> | |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const PersistentBase< Object > &wrapper, void *wrappable) |
template<CppHeapPointerTag tag> | |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper, void *wrappable) |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const v8::Local< v8::Object > &wrapper, void *wrappable, CppHeapPointerTag tag) |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const PersistentBase< Object > &wrapper, void *wrappable, CppHeapPointerTag tag) |
static V8_INLINE void | Wrap (v8::Isolate *isolate, const BasicTracedReference< Object > &wrapper, void *wrappable, CppHeapPointerTag tag) |
static V8_INLINE MaybeLocal< Context > | GetCreationContext (v8::Isolate *isolate, const PersistentBase< Object > &object) |
static V8_INLINE MaybeLocal< Context > | GetCreationContext (const PersistentBase< Object > &object) |
static V8_INLINE Isolate * | GetIsolate (const TracedReference< Object > &handle) |
static Local< Object > | New (Isolate *isolate) |
static Local< Object > | New (Isolate *isolate, Local< Value > prototype_or_null, Local< Name > *names, Local< Value > *values, size_t length) |
static V8_INLINE Object * | Cast (Value *obj) |
![]() | |
template<class T> | |
static V8_INLINE Value * | Cast (T *value) |
Static Public Attributes | |
static const int | kLineOffsetNotFound |
Additional Inherited Members | |
![]() | |
Local< Value > | prototype |
A JavaScript function object (ECMA-262, 15.3).
Definition at line 27 of file v8-function.h.
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Call | ( | Local< Context > | context, |
Local< Value > | recv, | ||
int | argc, | ||
Local< Value > | argv[] ) |
References V8_WARN_UNUSED_RESULT.
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Call | ( | v8::Isolate * | isolate, |
Local< Context > | context, | ||
Local< Value > | recv, | ||
int | argc, | ||
Local< Value > | argv[] ) |
References V8_WARN_UNUSED_RESULT.
Definition at line 133 of file v8-function.h.
References V8_INLINE.
V8_WARN_UNUSED_RESULT bool Experimental_IsNopFunction | ( | ) | const |
Returns true if the function does nothing. The function returns false on error. Note that this function is experimental. Embedders should not rely on this existing. We may remove this function in the future.
References V8_WARN_UNUSED_RESULT.
V8_WARN_UNUSED_RESULT MaybeLocal< String > FunctionProtoToString | ( | Local< Context > | context | ) |
Calls builtin Function.prototype.toString on this function. This is different from Value::ToString() that may call a user-defined toString() function, and different than Object::ObjectProtoToString() which always serializes "[object Function]".
References V8_WARN_UNUSED_RESULT.
Returns the original function if this function is bound, else returns v8::Undefined.
displayName if it is set, otherwise name if it is configured, otherwise function name, otherwise inferred name.
Name inferred from variable or property assignment of this function. Used to facilitate debugging and profiling of JavaScript code written in an OO style, where many functions are anonymous but are assigned to object properties.
int GetScriptColumnNumber | ( | ) | const |
Returns zero based column number of function body and kLineOffsetNotFound if no information available.
int GetScriptLineNumber | ( | ) | const |
Returns zero based line number of function body and kLineOffsetNotFound if no information available.
Location GetScriptLocation | ( | ) | const |
Returns zero based line and column number of function body, else returns {-1, -1}.
ScriptOrigin GetScriptOrigin | ( | ) | const |
int GetScriptStartPosition | ( | ) | const |
Returns zero based start position (character offset) of function body and kLineOffsetNotFound if no information available.
|
static |
Create a function in the current execution context for a given FunctionCallback.
References v8::kAllow, and v8::kHasSideEffect.
|
inline |
Definition at line 42 of file v8-function.h.
References NewInstance(), and V8_WARN_UNUSED_RESULT.
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewInstance | ( | Local< Context > | context, |
int | argc, | ||
Local< Value > | argv[] ) const |
References V8_WARN_UNUSED_RESULT.
Referenced by NewInstance().
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewInstanceWithSideEffectType | ( | Local< Context > | context, |
int | argc, | ||
Local< Value > | argv[], | ||
SideEffectType | side_effect_type = SideEffectType::kHasSideEffect ) const |
When side effect checks are enabled, passing kHasNoSideEffect allows the constructor to be invoked without throwing. Calls made within the constructor are still checked.
References v8::kHasSideEffect, and V8_WARN_UNUSED_RESULT.
int ScriptId | ( | ) | const |
Returns scriptId.
|
static |
Definition at line 140 of file v8-function.h.