v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Function Class Reference

#include <v8.h>

Inheritance diagram for Function:
Collaboration diagram for Function:

Public Member Functions

Local< ObjectNewInstance () const
 
Local< ObjectNewInstance (int argc, Handle< Value > argv[]) const
 
Local< ValueCall (Handle< Value > recv, int argc, Handle< Value > argv[])
 
void SetName (Handle< String > name)
 
Handle< ValueGetName () const
 
Handle< ValueGetInferredName () const
 
Handle< ValueGetDisplayName () const
 
int GetScriptLineNumber () const
 
int GetScriptColumnNumber () const
 
bool IsBuiltin () const
 
int ScriptId () const
 
Local< ValueGetBoundFunction () const
 
ScriptOrigin GetScriptOrigin () const
 
- Public Member Functions inherited from Object
bool Set (Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None)
 
bool Set (uint32_t index, Handle< Value > value)
 
bool ForceSet (Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None)
 
Local< ValueGet (Handle< Value > key)
 
Local< ValueGet (uint32_t index)
 
PropertyAttribute GetPropertyAttributes (Handle< Value > key)
 
bool Has (Handle< Value > key)
 
bool Delete (Handle< Value > key)
 
bool ForceDelete (Handle< Value > key)
 
bool Has (uint32_t index)
 
bool Delete (uint32_t index)
 
bool SetAccessor (Handle< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None)
 
bool SetDeclaredAccessor (Local< String > name, Local< DeclaredAccessorDescriptor > descriptor, PropertyAttribute attribute=None, AccessControl settings=DEFAULT)
 
void SetAccessorProperty (Local< String > name, Local< Function > getter, Handle< Function > setter=Handle< Function >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT)
 
bool HasPrivate (Handle< Private > key)
 
bool SetPrivate (Handle< Private > key, Handle< Value > value)
 
bool DeletePrivate (Handle< Private > key)
 
Local< ValueGetPrivate (Handle< Private > key)
 
Local< ArrayGetPropertyNames ()
 
Local< ArrayGetOwnPropertyNames ()
 
Local< ValueGetPrototype ()
 
bool SetPrototype (Handle< Value > prototype)
 
Local< ObjectFindInstanceInPrototypeChain (Handle< FunctionTemplate > tmpl)
 
Local< StringObjectProtoToString ()
 
Local< ValueGetConstructor ()
 
Local< StringGetConstructorName ()
 
int InternalFieldCount ()
 
V8_INLINE Local< ValueGetInternalField (int index)
 
void SetInternalField (int index, Handle< Value > value)
 
V8_INLINE void * GetAlignedPointerFromInternalField (int index)
 
void SetAlignedPointerInInternalField (int index, void *value)
 
bool HasOwnProperty (Handle< String > key)
 
bool HasRealNamedProperty (Handle< String > key)
 
bool HasRealIndexedProperty (uint32_t index)
 
bool HasRealNamedCallbackProperty (Handle< String > key)
 
Local< ValueGetRealNamedPropertyInPrototypeChain (Handle< String > key)
 
Local< ValueGetRealNamedProperty (Handle< String > key)
 
bool HasNamedLookupInterceptor ()
 
bool HasIndexedLookupInterceptor ()
 
void TurnOnAccessCheck ()
 
int GetIdentityHash ()
 
bool SetHiddenValue (Handle< String > key, Handle< Value > value)
 
Local< ValueGetHiddenValue (Handle< String > key)
 
bool DeleteHiddenValue (Handle< String > key)
 
bool IsDirty ()
 
Local< ObjectClone ()
 
Local< ContextCreationContext ()
 
void SetIndexedPropertiesToPixelData (uint8_t *data, int length)
 
bool HasIndexedPropertiesInPixelData ()
 
uint8_t * GetIndexedPropertiesPixelData ()
 
int GetIndexedPropertiesPixelDataLength ()
 
void SetIndexedPropertiesToExternalArrayData (void *data, ExternalArrayType array_type, int number_of_elements)
 
bool HasIndexedPropertiesInExternalArrayData ()
 
void * GetIndexedPropertiesExternalArrayData ()
 
ExternalArrayType GetIndexedPropertiesExternalArrayDataType ()
 
int GetIndexedPropertiesExternalArrayDataLength ()
 
bool IsCallable ()
 
Local< ValueCallAsFunction (Handle< Value > recv, int argc, Handle< Value > argv[])
 
Local< ValueCallAsConstructor (int argc, Handle< Value > argv[])
 
- Public Member Functions inherited from Value
V8_INLINE bool IsUndefined () const
 
V8_INLINE bool IsNull () const
 
bool IsTrue () const
 
bool IsFalse () const
 
V8_INLINE bool IsString () const
 
bool IsSymbol () const
 
bool IsFunction () const
 
bool IsArray () const
 
bool IsObject () const
 
bool IsBoolean () const
 
bool IsNumber () const
 
bool IsExternal () const
 
bool IsInt32 () const
 
bool IsUint32 () const
 
bool IsDate () const
 
bool IsBooleanObject () const
 
bool IsNumberObject () const
 
bool IsStringObject () const
 
bool IsSymbolObject () const
 
bool IsNativeError () const
 
bool IsRegExp () const
 
bool IsPromise () const
 
bool IsArrayBuffer () const
 
bool IsArrayBufferView () const
 
bool IsTypedArray () const
 
bool IsUint8Array () const
 
bool IsUint8ClampedArray () const
 
bool IsInt8Array () const
 
bool IsUint16Array () const
 
bool IsInt16Array () const
 
bool IsUint32Array () const
 
bool IsInt32Array () const
 
bool IsFloat32Array () const
 
bool IsFloat64Array () const
 
bool IsDataView () const
 
Local< BooleanToBoolean () const
 
Local< NumberToNumber () const
 
Local< StringToString () const
 
Local< StringToDetailString () const
 
Local< ObjectToObject () const
 
Local< IntegerToInteger () const
 
Local< Uint32ToUint32 () const
 
Local< Int32ToInt32 () const
 
Local< Uint32ToArrayIndex () const
 
bool BooleanValue () const
 
double NumberValue () const
 
int64_t IntegerValue () const
 
uint32_t Uint32Value () const
 
int32_t Int32Value () const
 
bool Equals (Handle< Value > that) const
 
bool StrictEquals (Handle< Value > that) const
 
bool SameValue (Handle< Value > that) const
 
template<class T >
ValueCast (T *value)
 

Static Public Member Functions

static Local< FunctionNew (Isolate *isolate, FunctionCallback callback, Local< Value > data=Local< Value >(), int length=0)
 
static V8_INLINE FunctionCast (Value *obj)
 
- Static Public Member Functions inherited from Object
static V8_INLINE int InternalFieldCount (const PersistentBase< Object > &object)
 
static V8_INLINE void * GetAlignedPointerFromInternalField (const PersistentBase< Object > &object, int index)
 
static Local< ObjectNew (Isolate *isolate)
 
static V8_INLINE ObjectCast (Value *obj)
 
- Static Public Member Functions inherited from Value
template<class T >
static V8_INLINE ValueCast (T *value)
 

Static Public Attributes

static const int kLineOffsetNotFound = -1
 

Detailed Description

A JavaScript function object (ECMA-262, 15.3).

Definition at line 2609 of file v8.h.

Member Function Documentation

Function * Cast ( v8::Value value)
static

Definition at line 6495 of file v8.h.

Local< v8::Value > GetBoundFunction ( ) const

Returns the original function if this function is bound, else returns v8::Undefined.

Definition at line 4123 of file api.cc.

References FixedArray::cast(), JSFunction::kBoundFunctionIndex, Utils::OpenHandle(), Utils::ToLocal(), and v8::Undefined().

Referenced by THREADED_TEST().

Handle< Value > GetDisplayName ( ) const

User-defined name assigned to the "displayName" property of this function. Used to facilitate debugging and profiling of JavaScript code.

Definition at line 4045 of file api.cc.

References String::cast(), ENTER_V8, Isolate::factory(), Factory::InternalizeOneByteString(), String::length(), ON_BAILOUT, Utils::OpenHandle(), STATIC_ASCII_VECTOR, and Utils::ToLocal().

Referenced by THREADED_TEST().

Handle< Value > GetInferredName ( ) const

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.

Definition at line 4038 of file api.cc.

References Utils::OpenHandle(), and Utils::ToLocal().

Referenced by THREADED_TEST().

Handle< Value > GetName ( ) const

Definition at line 4031 of file api.cc.

References Utils::OpenHandle(), and Utils::ToLocal().

Referenced by THREADED_TEST().

int GetScriptColumnNumber ( ) const

Returns zero based column number of function body and kLineOffsetNotFound if no information available.

Definition at line 4097 of file api.cc.

References Script::cast(), v8::internal::GetScriptColumnNumber(), Function::kLineOffsetNotFound, and Utils::OpenHandle().

Referenced by THREADED_TEST().

int GetScriptLineNumber ( ) const

Returns zero based line number of function body and kLineOffsetNotFound if no information available.

Definition at line 4087 of file api.cc.

References Script::cast(), v8::internal::GetScriptLineNumber(), Function::kLineOffsetNotFound, and Utils::OpenHandle().

Referenced by TEST(), and THREADED_TEST().

ScriptOrigin GetScriptOrigin ( ) const
bool IsBuiltin ( ) const

Tells whether this function is builtin.

Definition at line 4107 of file api.cc.

References Utils::OpenHandle().

Referenced by THREADED_TEST().

Local< Function > New ( Isolate isolate,
FunctionCallback  callback,
Local< Value data = Local<Value>(),
int  length = 0 
)
static

Create a function in the current execution context for a given FunctionCallback.

Definition at line 3957 of file api.cc.

References ENTER_V8, and LOG_API.

Referenced by THREADED_TEST().

Local< v8::Object > NewInstance ( ) const

Definition at line 3970 of file api.cc.

References NULL.

Referenced by TEST(), and THREADED_PROFILED_TEST().

int ScriptId ( ) const

Returns scriptId.

Definition at line 4113 of file api.cc.

References Script::cast(), UnboundScript::kNoScriptId, and Utils::OpenHandle().

Referenced by THREADED_TEST().

void SetName ( Handle< String name)

Definition at line 4022 of file api.cc.

References ENTER_V8, Utils::OpenHandle(), and v8::internal::USE().

Referenced by TEST().

Field Documentation

const int kLineOffsetNotFound = -1
static

Definition at line 2669 of file v8.h.

Referenced by Function::GetScriptColumnNumber(), and Function::GetScriptLineNumber().


The documentation for this class was generated from the following files: