|
@ -61,10 +61,6 @@ typedef unsigned __int64 uint64_t; |
|
|
// the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
|
|
|
// the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
|
|
|
// static library or building a program which uses the V8 static library neither
|
|
|
// static library or building a program which uses the V8 static library neither
|
|
|
// BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
|
|
|
// BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
|
|
|
// The reason for having both V8EXPORT and V8EXPORT_INLINE is that classes which
|
|
|
|
|
|
// have their code inside this header file need to have __declspec(dllexport)
|
|
|
|
|
|
// when building the DLL but cannot have __declspec(dllimport) when building
|
|
|
|
|
|
// a program which uses the DLL.
|
|
|
|
|
|
#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED) |
|
|
#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED) |
|
|
#error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\ |
|
|
#error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\ |
|
|
build configuration to ensure that at most one of these is set |
|
|
build configuration to ensure that at most one of these is set |
|
@ -72,13 +68,10 @@ typedef unsigned __int64 uint64_t; |
|
|
|
|
|
|
|
|
#ifdef BUILDING_V8_SHARED |
|
|
#ifdef BUILDING_V8_SHARED |
|
|
#define V8EXPORT __declspec(dllexport) |
|
|
#define V8EXPORT __declspec(dllexport) |
|
|
#define V8EXPORT_INLINE __declspec(dllexport) |
|
|
|
|
|
#elif USING_V8_SHARED |
|
|
#elif USING_V8_SHARED |
|
|
#define V8EXPORT __declspec(dllimport) |
|
|
#define V8EXPORT __declspec(dllimport) |
|
|
#define V8EXPORT_INLINE |
|
|
|
|
|
#else |
|
|
#else |
|
|
#define V8EXPORT |
|
|
#define V8EXPORT |
|
|
#define V8EXPORT_INLINE |
|
|
|
|
|
#endif // BUILDING_V8_SHARED
|
|
|
#endif // BUILDING_V8_SHARED
|
|
|
|
|
|
|
|
|
#else // _WIN32
|
|
|
#else // _WIN32
|
|
@ -90,10 +83,8 @@ typedef unsigned __int64 uint64_t; |
|
|
// export symbols when we are building a static library.
|
|
|
// export symbols when we are building a static library.
|
|
|
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED) |
|
|
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED) |
|
|
#define V8EXPORT __attribute__ ((visibility("default"))) |
|
|
#define V8EXPORT __attribute__ ((visibility("default"))) |
|
|
#define V8EXPORT_INLINE __attribute__ ((visibility("default"))) |
|
|
|
|
|
#else // defined(__GNUC__) && (__GNUC__ >= 4)
|
|
|
#else // defined(__GNUC__) && (__GNUC__ >= 4)
|
|
|
#define V8EXPORT |
|
|
#define V8EXPORT |
|
|
#define V8EXPORT_INLINE |
|
|
|
|
|
#endif // defined(__GNUC__) && (__GNUC__ >= 4)
|
|
|
#endif // defined(__GNUC__) && (__GNUC__ >= 4)
|
|
|
|
|
|
|
|
|
#endif // _WIN32
|
|
|
#endif // _WIN32
|
|
@ -185,7 +176,7 @@ typedef void (*WeakReferenceCallback)(Persistent<Value> object, |
|
|
* behind the scenes and the same rules apply to these values as to |
|
|
* behind the scenes and the same rules apply to these values as to |
|
|
* their handles. |
|
|
* their handles. |
|
|
*/ |
|
|
*/ |
|
|
template <class T> class V8EXPORT_INLINE Handle { |
|
|
template <class T> class Handle { |
|
|
public: |
|
|
public: |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
@ -196,7 +187,7 @@ template <class T> class V8EXPORT_INLINE Handle { |
|
|
/**
|
|
|
/**
|
|
|
* Creates a new handle for the specified value. |
|
|
* Creates a new handle for the specified value. |
|
|
*/ |
|
|
*/ |
|
|
explicit Handle(T* val) : val_(val) { } |
|
|
inline explicit Handle(T* val) : val_(val) { } |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Creates a handle for the contents of the specified handle. This |
|
|
* Creates a handle for the contents of the specified handle. This |
|
@ -221,16 +212,16 @@ template <class T> class V8EXPORT_INLINE Handle { |
|
|
/**
|
|
|
/**
|
|
|
* Returns true if the handle is empty. |
|
|
* Returns true if the handle is empty. |
|
|
*/ |
|
|
*/ |
|
|
bool IsEmpty() const { return val_ == 0; } |
|
|
inline bool IsEmpty() const { return val_ == 0; } |
|
|
|
|
|
|
|
|
T* operator->() const { return val_; } |
|
|
inline T* operator->() const { return val_; } |
|
|
|
|
|
|
|
|
T* operator*() const { return val_; } |
|
|
inline T* operator*() const { return val_; } |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Sets the handle to be empty. IsEmpty() will then return true. |
|
|
* Sets the handle to be empty. IsEmpty() will then return true. |
|
|
*/ |
|
|
*/ |
|
|
void Clear() { this->val_ = 0; } |
|
|
inline void Clear() { this->val_ = 0; } |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Checks whether two handles are the same. |
|
|
* Checks whether two handles are the same. |
|
@ -238,7 +229,7 @@ template <class T> class V8EXPORT_INLINE Handle { |
|
|
* to which they refer are identical. |
|
|
* to which they refer are identical. |
|
|
* The handles' references are not checked. |
|
|
* The handles' references are not checked. |
|
|
*/ |
|
|
*/ |
|
|
template <class S> bool operator==(Handle<S> that) const { |
|
|
template <class S> inline bool operator==(Handle<S> that) const { |
|
|
internal::Object** a = reinterpret_cast<internal::Object**>(**this); |
|
|
internal::Object** a = reinterpret_cast<internal::Object**>(**this); |
|
|
internal::Object** b = reinterpret_cast<internal::Object**>(*that); |
|
|
internal::Object** b = reinterpret_cast<internal::Object**>(*that); |
|
|
if (a == 0) return b == 0; |
|
|
if (a == 0) return b == 0; |
|
@ -252,7 +243,7 @@ template <class T> class V8EXPORT_INLINE Handle { |
|
|
* the objects to which they refer are different. |
|
|
* the objects to which they refer are different. |
|
|
* The handles' references are not checked. |
|
|
* The handles' references are not checked. |
|
|
*/ |
|
|
*/ |
|
|
template <class S> bool operator!=(Handle<S> that) const { |
|
|
template <class S> inline bool operator!=(Handle<S> that) const { |
|
|
return !operator==(that); |
|
|
return !operator==(that); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -281,7 +272,7 @@ template <class T> class V8EXPORT_INLINE Handle { |
|
|
* handle scope are destroyed when the handle scope is destroyed. Hence it |
|
|
* handle scope are destroyed when the handle scope is destroyed. Hence it |
|
|
* is not necessary to explicitly deallocate local handles. |
|
|
* is not necessary to explicitly deallocate local handles. |
|
|
*/ |
|
|
*/ |
|
|
template <class T> class V8EXPORT_INLINE Local : public Handle<T> { |
|
|
template <class T> class Local : public Handle<T> { |
|
|
public: |
|
|
public: |
|
|
inline Local(); |
|
|
inline Local(); |
|
|
template <class S> inline Local(Local<S> that) |
|
|
template <class S> inline Local(Local<S> that) |
|
@ -332,7 +323,7 @@ template <class T> class V8EXPORT_INLINE Local : public Handle<T> { |
|
|
* different storage cells but rather two references to the same |
|
|
* different storage cells but rather two references to the same |
|
|
* storage cell. |
|
|
* storage cell. |
|
|
*/ |
|
|
*/ |
|
|
template <class T> class V8EXPORT_INLINE Persistent : public Handle<T> { |
|
|
template <class T> class Persistent : public Handle<T> { |
|
|
public: |
|
|
public: |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
@ -563,9 +554,10 @@ class V8EXPORT ScriptData { // NOLINT |
|
|
/**
|
|
|
/**
|
|
|
* The origin, within a file, of a script. |
|
|
* The origin, within a file, of a script. |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT ScriptOrigin { |
|
|
class ScriptOrigin { |
|
|
public: |
|
|
public: |
|
|
ScriptOrigin(Handle<Value> resource_name, |
|
|
inline ScriptOrigin( |
|
|
|
|
|
Handle<Value> resource_name, |
|
|
Handle<Integer> resource_line_offset = Handle<Integer>(), |
|
|
Handle<Integer> resource_line_offset = Handle<Integer>(), |
|
|
Handle<Integer> resource_column_offset = Handle<Integer>()) |
|
|
Handle<Integer> resource_column_offset = Handle<Integer>()) |
|
|
: resource_name_(resource_name), |
|
|
: resource_name_(resource_name), |
|
@ -841,30 +833,30 @@ class V8EXPORT StackFrame { |
|
|
/**
|
|
|
/**
|
|
|
* The superclass of all JavaScript values and objects. |
|
|
* The superclass of all JavaScript values and objects. |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Value : public Data { |
|
|
class Value : public Data { |
|
|
public: |
|
|
public: |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is the undefined value. See ECMA-262 |
|
|
* Returns true if this value is the undefined value. See ECMA-262 |
|
|
* 4.3.10. |
|
|
* 4.3.10. |
|
|
*/ |
|
|
*/ |
|
|
bool IsUndefined() const; |
|
|
V8EXPORT bool IsUndefined() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is the null value. See ECMA-262 |
|
|
* Returns true if this value is the null value. See ECMA-262 |
|
|
* 4.3.11. |
|
|
* 4.3.11. |
|
|
*/ |
|
|
*/ |
|
|
bool IsNull() const; |
|
|
V8EXPORT bool IsNull() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is true. |
|
|
* Returns true if this value is true. |
|
|
*/ |
|
|
*/ |
|
|
bool IsTrue() const; |
|
|
V8EXPORT bool IsTrue() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is false. |
|
|
* Returns true if this value is false. |
|
|
*/ |
|
|
*/ |
|
|
bool IsFalse() const; |
|
|
V8EXPORT bool IsFalse() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is an instance of the String type. |
|
|
* Returns true if this value is an instance of the String type. |
|
@ -875,92 +867,92 @@ class V8EXPORT Value : public Data { |
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is a function. |
|
|
* Returns true if this value is a function. |
|
|
*/ |
|
|
*/ |
|
|
bool IsFunction() const; |
|
|
V8EXPORT bool IsFunction() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is an array. |
|
|
* Returns true if this value is an array. |
|
|
*/ |
|
|
*/ |
|
|
bool IsArray() const; |
|
|
V8EXPORT bool IsArray() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is an object. |
|
|
* Returns true if this value is an object. |
|
|
*/ |
|
|
*/ |
|
|
bool IsObject() const; |
|
|
V8EXPORT bool IsObject() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is boolean. |
|
|
* Returns true if this value is boolean. |
|
|
*/ |
|
|
*/ |
|
|
bool IsBoolean() const; |
|
|
V8EXPORT bool IsBoolean() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is a number. |
|
|
* Returns true if this value is a number. |
|
|
*/ |
|
|
*/ |
|
|
bool IsNumber() const; |
|
|
V8EXPORT bool IsNumber() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is external. |
|
|
* Returns true if this value is external. |
|
|
*/ |
|
|
*/ |
|
|
bool IsExternal() const; |
|
|
V8EXPORT bool IsExternal() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is a 32-bit signed integer. |
|
|
* Returns true if this value is a 32-bit signed integer. |
|
|
*/ |
|
|
*/ |
|
|
bool IsInt32() const; |
|
|
V8EXPORT bool IsInt32() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is a 32-bit unsigned integer. |
|
|
* Returns true if this value is a 32-bit unsigned integer. |
|
|
*/ |
|
|
*/ |
|
|
bool IsUint32() const; |
|
|
V8EXPORT bool IsUint32() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this value is a Date. |
|
|
* Returns true if this value is a Date. |
|
|
*/ |
|
|
*/ |
|
|
bool IsDate() const; |
|
|
V8EXPORT bool IsDate() const; |
|
|
|
|
|
|
|
|
Local<Boolean> ToBoolean() const; |
|
|
V8EXPORT Local<Boolean> ToBoolean() const; |
|
|
Local<Number> ToNumber() const; |
|
|
V8EXPORT Local<Number> ToNumber() const; |
|
|
Local<String> ToString() const; |
|
|
V8EXPORT Local<String> ToString() const; |
|
|
Local<String> ToDetailString() const; |
|
|
V8EXPORT Local<String> ToDetailString() const; |
|
|
Local<Object> ToObject() const; |
|
|
V8EXPORT Local<Object> ToObject() const; |
|
|
Local<Integer> ToInteger() const; |
|
|
V8EXPORT Local<Integer> ToInteger() const; |
|
|
Local<Uint32> ToUint32() const; |
|
|
V8EXPORT Local<Uint32> ToUint32() const; |
|
|
Local<Int32> ToInt32() const; |
|
|
V8EXPORT Local<Int32> ToInt32() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Attempts to convert a string to an array index. |
|
|
* Attempts to convert a string to an array index. |
|
|
* Returns an empty handle if the conversion fails. |
|
|
* Returns an empty handle if the conversion fails. |
|
|
*/ |
|
|
*/ |
|
|
Local<Uint32> ToArrayIndex() const; |
|
|
V8EXPORT Local<Uint32> ToArrayIndex() const; |
|
|
|
|
|
|
|
|
bool BooleanValue() const; |
|
|
V8EXPORT bool BooleanValue() const; |
|
|
double NumberValue() const; |
|
|
V8EXPORT double NumberValue() const; |
|
|
int64_t IntegerValue() const; |
|
|
V8EXPORT int64_t IntegerValue() const; |
|
|
uint32_t Uint32Value() const; |
|
|
V8EXPORT uint32_t Uint32Value() const; |
|
|
int32_t Int32Value() const; |
|
|
V8EXPORT int32_t Int32Value() const; |
|
|
|
|
|
|
|
|
/** JS == */ |
|
|
/** JS == */ |
|
|
bool Equals(Handle<Value> that) const; |
|
|
V8EXPORT bool Equals(Handle<Value> that) const; |
|
|
bool StrictEquals(Handle<Value> that) const; |
|
|
V8EXPORT bool StrictEquals(Handle<Value> that) const; |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
inline bool QuickIsString() const; |
|
|
inline bool QuickIsString() const; |
|
|
bool FullIsString() const; |
|
|
V8EXPORT bool FullIsString() const; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* The superclass of primitive values. See ECMA-262 4.3.2. |
|
|
* The superclass of primitive values. See ECMA-262 4.3.2. |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Primitive : public Value { }; |
|
|
class Primitive : public Value { }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* A primitive boolean value (ECMA-262, 4.3.14). Either the true |
|
|
* A primitive boolean value (ECMA-262, 4.3.14). Either the true |
|
|
* or false value. |
|
|
* or false value. |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Boolean : public Primitive { |
|
|
class Boolean : public Primitive { |
|
|
public: |
|
|
public: |
|
|
bool Value() const; |
|
|
V8EXPORT bool Value() const; |
|
|
static inline Handle<Boolean> New(bool value); |
|
|
static inline Handle<Boolean> New(bool value); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -968,19 +960,19 @@ class V8EXPORT Boolean : public Primitive { |
|
|
/**
|
|
|
/**
|
|
|
* A JavaScript string value (ECMA-262, 4.3.17). |
|
|
* A JavaScript string value (ECMA-262, 4.3.17). |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT String : public Primitive { |
|
|
class String : public Primitive { |
|
|
public: |
|
|
public: |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns the number of characters in this string. |
|
|
* Returns the number of characters in this string. |
|
|
*/ |
|
|
*/ |
|
|
int Length() const; |
|
|
V8EXPORT int Length() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns the number of bytes in the UTF-8 encoded |
|
|
* Returns the number of bytes in the UTF-8 encoded |
|
|
* representation of this string. |
|
|
* representation of this string. |
|
|
*/ |
|
|
*/ |
|
|
int Utf8Length() const; |
|
|
V8EXPORT int Utf8Length() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Write the contents of the string to an external buffer. |
|
|
* Write the contents of the string to an external buffer. |
|
@ -1007,15 +999,15 @@ class V8EXPORT String : public Primitive { |
|
|
HINT_MANY_WRITES_EXPECTED = 1 |
|
|
HINT_MANY_WRITES_EXPECTED = 1 |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
int Write(uint16_t* buffer, |
|
|
V8EXPORT int Write(uint16_t* buffer, |
|
|
int start = 0, |
|
|
int start = 0, |
|
|
int length = -1, |
|
|
int length = -1, |
|
|
WriteHints hints = NO_HINTS) const; // UTF-16
|
|
|
WriteHints hints = NO_HINTS) const; // UTF-16
|
|
|
int WriteAscii(char* buffer, |
|
|
V8EXPORT int WriteAscii(char* buffer, |
|
|
int start = 0, |
|
|
int start = 0, |
|
|
int length = -1, |
|
|
int length = -1, |
|
|
WriteHints hints = NO_HINTS) const; // ASCII
|
|
|
WriteHints hints = NO_HINTS) const; // ASCII
|
|
|
int WriteUtf8(char* buffer, |
|
|
V8EXPORT int WriteUtf8(char* buffer, |
|
|
int length = -1, |
|
|
int length = -1, |
|
|
int* nchars_ref = NULL, |
|
|
int* nchars_ref = NULL, |
|
|
WriteHints hints = NO_HINTS) const; // UTF-8
|
|
|
WriteHints hints = NO_HINTS) const; // UTF-8
|
|
@ -1023,17 +1015,17 @@ class V8EXPORT String : public Primitive { |
|
|
/**
|
|
|
/**
|
|
|
* A zero length string. |
|
|
* A zero length string. |
|
|
*/ |
|
|
*/ |
|
|
static v8::Local<v8::String> Empty(); |
|
|
V8EXPORT static v8::Local<v8::String> Empty(); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if the string is external |
|
|
* Returns true if the string is external |
|
|
*/ |
|
|
*/ |
|
|
bool IsExternal() const; |
|
|
V8EXPORT bool IsExternal() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if the string is both external and ascii |
|
|
* Returns true if the string is both external and ascii |
|
|
*/ |
|
|
*/ |
|
|
bool IsExternalAscii() const; |
|
|
V8EXPORT bool IsExternalAscii() const; |
|
|
|
|
|
|
|
|
class V8EXPORT ExternalStringResourceBase { |
|
|
class V8EXPORT ExternalStringResourceBase { |
|
|
public: |
|
|
public: |
|
@ -1124,7 +1116,7 @@ class V8EXPORT String : public Primitive { |
|
|
* Get the ExternalAsciiStringResource for an external ascii string. |
|
|
* Get the ExternalAsciiStringResource for an external ascii string. |
|
|
* Returns NULL if IsExternalAscii() doesn't return true. |
|
|
* Returns NULL if IsExternalAscii() doesn't return true. |
|
|
*/ |
|
|
*/ |
|
|
ExternalAsciiStringResource* GetExternalAsciiStringResource() const; |
|
|
V8EXPORT ExternalAsciiStringResource* GetExternalAsciiStringResource() const; |
|
|
|
|
|
|
|
|
static inline String* Cast(v8::Value* obj); |
|
|
static inline String* Cast(v8::Value* obj); |
|
|
|
|
|
|
|
@ -1137,19 +1129,20 @@ class V8EXPORT String : public Primitive { |
|
|
* 'strlen' to determine the buffer length, it might be |
|
|
* 'strlen' to determine the buffer length, it might be |
|
|
* wrong if 'data' contains a null character. |
|
|
* wrong if 'data' contains a null character. |
|
|
*/ |
|
|
*/ |
|
|
static Local<String> New(const char* data, int length = -1); |
|
|
V8EXPORT static Local<String> New(const char* data, int length = -1); |
|
|
|
|
|
|
|
|
/** Allocates a new string from utf16 data.*/ |
|
|
/** Allocates a new string from utf16 data.*/ |
|
|
static Local<String> New(const uint16_t* data, int length = -1); |
|
|
V8EXPORT static Local<String> New(const uint16_t* data, int length = -1); |
|
|
|
|
|
|
|
|
/** Creates a symbol. Returns one if it exists already.*/ |
|
|
/** Creates a symbol. Returns one if it exists already.*/ |
|
|
static Local<String> NewSymbol(const char* data, int length = -1); |
|
|
V8EXPORT static Local<String> NewSymbol(const char* data, int length = -1); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Creates a new string by concatenating the left and the right strings |
|
|
* Creates a new string by concatenating the left and the right strings |
|
|
* passed in as parameters. |
|
|
* passed in as parameters. |
|
|
*/ |
|
|
*/ |
|
|
static Local<String> Concat(Handle<String> left, Handle<String>right); |
|
|
V8EXPORT static Local<String> Concat(Handle<String> left, |
|
|
|
|
|
Handle<String>right); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Creates a new external string using the data defined in the given |
|
|
* Creates a new external string using the data defined in the given |
|
@ -1159,7 +1152,7 @@ class V8EXPORT String : public Primitive { |
|
|
* should the underlying buffer be deallocated or modified except through the |
|
|
* should the underlying buffer be deallocated or modified except through the |
|
|
* destructor of the external string resource. |
|
|
* destructor of the external string resource. |
|
|
*/ |
|
|
*/ |
|
|
static Local<String> NewExternal(ExternalStringResource* resource); |
|
|
V8EXPORT static Local<String> NewExternal(ExternalStringResource* resource); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Associate an external string resource with this string by transforming it |
|
|
* Associate an external string resource with this string by transforming it |
|
@ -1170,7 +1163,7 @@ class V8EXPORT String : public Primitive { |
|
|
* The string is not modified if the operation fails. See NewExternal for |
|
|
* The string is not modified if the operation fails. See NewExternal for |
|
|
* information on the lifetime of the resource. |
|
|
* information on the lifetime of the resource. |
|
|
*/ |
|
|
*/ |
|
|
bool MakeExternal(ExternalStringResource* resource); |
|
|
V8EXPORT bool MakeExternal(ExternalStringResource* resource); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Creates a new external string using the ascii data defined in the given |
|
|
* Creates a new external string using the ascii data defined in the given |
|
@ -1180,7 +1173,8 @@ class V8EXPORT String : public Primitive { |
|
|
* should the underlying buffer be deallocated or modified except through the |
|
|
* should the underlying buffer be deallocated or modified except through the |
|
|
* destructor of the external string resource. |
|
|
* destructor of the external string resource. |
|
|
*/ |
|
|
*/ |
|
|
static Local<String> NewExternal(ExternalAsciiStringResource* resource); |
|
|
V8EXPORT static Local<String> NewExternal( |
|
|
|
|
|
ExternalAsciiStringResource* resource); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Associate an external string resource with this string by transforming it |
|
|
* Associate an external string resource with this string by transforming it |
|
@ -1191,18 +1185,20 @@ class V8EXPORT String : public Primitive { |
|
|
* The string is not modified if the operation fails. See NewExternal for |
|
|
* The string is not modified if the operation fails. See NewExternal for |
|
|
* information on the lifetime of the resource. |
|
|
* information on the lifetime of the resource. |
|
|
*/ |
|
|
*/ |
|
|
bool MakeExternal(ExternalAsciiStringResource* resource); |
|
|
V8EXPORT bool MakeExternal(ExternalAsciiStringResource* resource); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this string can be made external. |
|
|
* Returns true if this string can be made external. |
|
|
*/ |
|
|
*/ |
|
|
bool CanMakeExternal(); |
|
|
V8EXPORT bool CanMakeExternal(); |
|
|
|
|
|
|
|
|
/** Creates an undetectable string from the supplied ascii or utf-8 data.*/ |
|
|
/** Creates an undetectable string from the supplied ascii or utf-8 data.*/ |
|
|
static Local<String> NewUndetectable(const char* data, int length = -1); |
|
|
V8EXPORT static Local<String> NewUndetectable(const char* data, |
|
|
|
|
|
int length = -1); |
|
|
|
|
|
|
|
|
/** Creates an undetectable string from the supplied utf-16 data.*/ |
|
|
/** Creates an undetectable string from the supplied utf-16 data.*/ |
|
|
static Local<String> NewUndetectable(const uint16_t* data, int length = -1); |
|
|
V8EXPORT static Local<String> NewUndetectable(const uint16_t* data, |
|
|
|
|
|
int length = -1); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Converts an object to a utf8-encoded character array. Useful if |
|
|
* Converts an object to a utf8-encoded character array. Useful if |
|
@ -1273,21 +1269,21 @@ class V8EXPORT String : public Primitive { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
void VerifyExternalStringResource(ExternalStringResource* val) const; |
|
|
V8EXPORT void VerifyExternalStringResource(ExternalStringResource* val) const; |
|
|
static void CheckCast(v8::Value* obj); |
|
|
V8EXPORT static void CheckCast(v8::Value* obj); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* A JavaScript number value (ECMA-262, 4.3.20) |
|
|
* A JavaScript number value (ECMA-262, 4.3.20) |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Number : public Primitive { |
|
|
class Number : public Primitive { |
|
|
public: |
|
|
public: |
|
|
double Value() const; |
|
|
V8EXPORT double Value() const; |
|
|
static Local<Number> New(double value); |
|
|
V8EXPORT static Local<Number> New(double value); |
|
|
static inline Number* Cast(v8::Value* obj); |
|
|
static inline Number* Cast(v8::Value* obj); |
|
|
private: |
|
|
private: |
|
|
Number(); |
|
|
V8EXPORT Number(); |
|
|
static void CheckCast(v8::Value* obj); |
|
|
static void CheckCast(v8::Value* obj); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -1295,56 +1291,56 @@ class V8EXPORT Number : public Primitive { |
|
|
/**
|
|
|
/**
|
|
|
* A JavaScript value representing a signed integer. |
|
|
* A JavaScript value representing a signed integer. |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Integer : public Number { |
|
|
class Integer : public Number { |
|
|
public: |
|
|
public: |
|
|
static Local<Integer> New(int32_t value); |
|
|
V8EXPORT static Local<Integer> New(int32_t value); |
|
|
static Local<Integer> NewFromUnsigned(uint32_t value); |
|
|
V8EXPORT static Local<Integer> NewFromUnsigned(uint32_t value); |
|
|
int64_t Value() const; |
|
|
V8EXPORT int64_t Value() const; |
|
|
static inline Integer* Cast(v8::Value* obj); |
|
|
static inline Integer* Cast(v8::Value* obj); |
|
|
private: |
|
|
private: |
|
|
Integer(); |
|
|
V8EXPORT Integer(); |
|
|
static void CheckCast(v8::Value* obj); |
|
|
V8EXPORT static void CheckCast(v8::Value* obj); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* A JavaScript value representing a 32-bit signed integer. |
|
|
* A JavaScript value representing a 32-bit signed integer. |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Int32 : public Integer { |
|
|
class Int32 : public Integer { |
|
|
public: |
|
|
public: |
|
|
int32_t Value() const; |
|
|
V8EXPORT int32_t Value() const; |
|
|
private: |
|
|
private: |
|
|
Int32(); |
|
|
V8EXPORT Int32(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* A JavaScript value representing a 32-bit unsigned integer. |
|
|
* A JavaScript value representing a 32-bit unsigned integer. |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Uint32 : public Integer { |
|
|
class Uint32 : public Integer { |
|
|
public: |
|
|
public: |
|
|
uint32_t Value() const; |
|
|
V8EXPORT uint32_t Value() const; |
|
|
private: |
|
|
private: |
|
|
Uint32(); |
|
|
V8EXPORT Uint32(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* An instance of the built-in Date constructor (ECMA-262, 15.9). |
|
|
* An instance of the built-in Date constructor (ECMA-262, 15.9). |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Date : public Value { |
|
|
class Date : public Value { |
|
|
public: |
|
|
public: |
|
|
static Local<Value> New(double time); |
|
|
V8EXPORT static Local<Value> New(double time); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* A specialization of Value::NumberValue that is more efficient |
|
|
* A specialization of Value::NumberValue that is more efficient |
|
|
* because we know the structure of this object. |
|
|
* because we know the structure of this object. |
|
|
*/ |
|
|
*/ |
|
|
double NumberValue() const; |
|
|
V8EXPORT double NumberValue() const; |
|
|
|
|
|
|
|
|
static inline Date* Cast(v8::Value* obj); |
|
|
static inline Date* Cast(v8::Value* obj); |
|
|
private: |
|
|
private: |
|
|
static void CheckCast(v8::Value* obj); |
|
|
V8EXPORT static void CheckCast(v8::Value* obj); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1403,13 +1399,13 @@ enum AccessControl { |
|
|
/**
|
|
|
/**
|
|
|
* A JavaScript object (ECMA-262, 4.3.3) |
|
|
* A JavaScript object (ECMA-262, 4.3.3) |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Object : public Value { |
|
|
class Object : public Value { |
|
|
public: |
|
|
public: |
|
|
bool Set(Handle<Value> key, |
|
|
V8EXPORT bool Set(Handle<Value> key, |
|
|
Handle<Value> value, |
|
|
Handle<Value> value, |
|
|
PropertyAttribute attribs = None); |
|
|
PropertyAttribute attribs = None); |
|
|
|
|
|
|
|
|
bool Set(uint32_t index, |
|
|
V8EXPORT bool Set(uint32_t index, |
|
|
Handle<Value> value); |
|
|
Handle<Value> value); |
|
|
|
|
|
|
|
|
// Sets a local property on this object bypassing interceptors and
|
|
|
// Sets a local property on this object bypassing interceptors and
|
|
@ -1420,29 +1416,29 @@ class V8EXPORT Object : public Value { |
|
|
// will only be returned if the interceptor doesn't return a value.
|
|
|
// will only be returned if the interceptor doesn't return a value.
|
|
|
//
|
|
|
//
|
|
|
// Note also that this only works for named properties.
|
|
|
// Note also that this only works for named properties.
|
|
|
bool ForceSet(Handle<Value> key, |
|
|
V8EXPORT bool ForceSet(Handle<Value> key, |
|
|
Handle<Value> value, |
|
|
Handle<Value> value, |
|
|
PropertyAttribute attribs = None); |
|
|
PropertyAttribute attribs = None); |
|
|
|
|
|
|
|
|
Local<Value> Get(Handle<Value> key); |
|
|
V8EXPORT Local<Value> Get(Handle<Value> key); |
|
|
|
|
|
|
|
|
Local<Value> Get(uint32_t index); |
|
|
V8EXPORT Local<Value> Get(uint32_t index); |
|
|
|
|
|
|
|
|
// TODO(1245389): Replace the type-specific versions of these
|
|
|
// TODO(1245389): Replace the type-specific versions of these
|
|
|
// functions with generic ones that accept a Handle<Value> key.
|
|
|
// functions with generic ones that accept a Handle<Value> key.
|
|
|
bool Has(Handle<String> key); |
|
|
V8EXPORT bool Has(Handle<String> key); |
|
|
|
|
|
|
|
|
bool Delete(Handle<String> key); |
|
|
V8EXPORT bool Delete(Handle<String> key); |
|
|
|
|
|
|
|
|
// Delete a property on this object bypassing interceptors and
|
|
|
// Delete a property on this object bypassing interceptors and
|
|
|
// ignoring dont-delete attributes.
|
|
|
// ignoring dont-delete attributes.
|
|
|
bool ForceDelete(Handle<Value> key); |
|
|
V8EXPORT bool ForceDelete(Handle<Value> key); |
|
|
|
|
|
|
|
|
bool Has(uint32_t index); |
|
|
V8EXPORT bool Has(uint32_t index); |
|
|
|
|
|
|
|
|
bool Delete(uint32_t index); |
|
|
V8EXPORT bool Delete(uint32_t index); |
|
|
|
|
|
|
|
|
bool SetAccessor(Handle<String> name, |
|
|
V8EXPORT bool SetAccessor(Handle<String> name, |
|
|
AccessorGetter getter, |
|
|
AccessorGetter getter, |
|
|
AccessorSetter setter = 0, |
|
|
AccessorSetter setter = 0, |
|
|
Handle<Value> data = Handle<Value>(), |
|
|
Handle<Value> data = Handle<Value>(), |
|
@ -1455,78 +1451,80 @@ class V8EXPORT Object : public Value { |
|
|
* array returned by this method contains the same values as would |
|
|
* array returned by this method contains the same values as would |
|
|
* be enumerated by a for-in statement over this object. |
|
|
* be enumerated by a for-in statement over this object. |
|
|
*/ |
|
|
*/ |
|
|
Local<Array> GetPropertyNames(); |
|
|
V8EXPORT Local<Array> GetPropertyNames(); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Get the prototype object. This does not skip objects marked to |
|
|
* Get the prototype object. This does not skip objects marked to |
|
|
* be skipped by __proto__ and it does not consult the security |
|
|
* be skipped by __proto__ and it does not consult the security |
|
|
* handler. |
|
|
* handler. |
|
|
*/ |
|
|
*/ |
|
|
Local<Value> GetPrototype(); |
|
|
V8EXPORT Local<Value> GetPrototype(); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Set the prototype object. This does not skip objects marked to |
|
|
* Set the prototype object. This does not skip objects marked to |
|
|
* be skipped by __proto__ and it does not consult the security |
|
|
* be skipped by __proto__ and it does not consult the security |
|
|
* handler. |
|
|
* handler. |
|
|
*/ |
|
|
*/ |
|
|
bool SetPrototype(Handle<Value> prototype); |
|
|
V8EXPORT bool SetPrototype(Handle<Value> prototype); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Finds an instance of the given function template in the prototype |
|
|
* Finds an instance of the given function template in the prototype |
|
|
* chain. |
|
|
* chain. |
|
|
*/ |
|
|
*/ |
|
|
Local<Object> FindInstanceInPrototypeChain(Handle<FunctionTemplate> tmpl); |
|
|
V8EXPORT Local<Object> FindInstanceInPrototypeChain( |
|
|
|
|
|
Handle<FunctionTemplate> tmpl); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Call builtin Object.prototype.toString on this object. |
|
|
* Call builtin Object.prototype.toString on this object. |
|
|
* This is different from Value::ToString() that may call |
|
|
* This is different from Value::ToString() that may call |
|
|
* user-defined toString function. This one does not. |
|
|
* user-defined toString function. This one does not. |
|
|
*/ |
|
|
*/ |
|
|
Local<String> ObjectProtoToString(); |
|
|
V8EXPORT Local<String> ObjectProtoToString(); |
|
|
|
|
|
|
|
|
/** Gets the number of internal fields for this Object. */ |
|
|
/** Gets the number of internal fields for this Object. */ |
|
|
int InternalFieldCount(); |
|
|
V8EXPORT int InternalFieldCount(); |
|
|
/** Gets the value in an internal field. */ |
|
|
/** Gets the value in an internal field. */ |
|
|
inline Local<Value> GetInternalField(int index); |
|
|
inline Local<Value> GetInternalField(int index); |
|
|
/** Sets the value in an internal field. */ |
|
|
/** Sets the value in an internal field. */ |
|
|
void SetInternalField(int index, Handle<Value> value); |
|
|
V8EXPORT void SetInternalField(int index, Handle<Value> value); |
|
|
|
|
|
|
|
|
/** Gets a native pointer from an internal field. */ |
|
|
/** Gets a native pointer from an internal field. */ |
|
|
inline void* GetPointerFromInternalField(int index); |
|
|
inline void* GetPointerFromInternalField(int index); |
|
|
|
|
|
|
|
|
/** Sets a native pointer in an internal field. */ |
|
|
/** Sets a native pointer in an internal field. */ |
|
|
void SetPointerInInternalField(int index, void* value); |
|
|
V8EXPORT void SetPointerInInternalField(int index, void* value); |
|
|
|
|
|
|
|
|
// Testers for local properties.
|
|
|
// Testers for local properties.
|
|
|
bool HasRealNamedProperty(Handle<String> key); |
|
|
V8EXPORT bool HasRealNamedProperty(Handle<String> key); |
|
|
bool HasRealIndexedProperty(uint32_t index); |
|
|
V8EXPORT bool HasRealIndexedProperty(uint32_t index); |
|
|
bool HasRealNamedCallbackProperty(Handle<String> key); |
|
|
V8EXPORT bool HasRealNamedCallbackProperty(Handle<String> key); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* If result.IsEmpty() no real property was located in the prototype chain. |
|
|
* If result.IsEmpty() no real property was located in the prototype chain. |
|
|
* This means interceptors in the prototype chain are not called. |
|
|
* This means interceptors in the prototype chain are not called. |
|
|
*/ |
|
|
*/ |
|
|
Local<Value> GetRealNamedPropertyInPrototypeChain(Handle<String> key); |
|
|
V8EXPORT Local<Value> GetRealNamedPropertyInPrototypeChain( |
|
|
|
|
|
Handle<String> key); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* If result.IsEmpty() no real property was located on the object or |
|
|
* If result.IsEmpty() no real property was located on the object or |
|
|
* in the prototype chain. |
|
|
* in the prototype chain. |
|
|
* This means interceptors in the prototype chain are not called. |
|
|
* This means interceptors in the prototype chain are not called. |
|
|
*/ |
|
|
*/ |
|
|
Local<Value> GetRealNamedProperty(Handle<String> key); |
|
|
V8EXPORT Local<Value> GetRealNamedProperty(Handle<String> key); |
|
|
|
|
|
|
|
|
/** Tests for a named lookup interceptor.*/ |
|
|
/** Tests for a named lookup interceptor.*/ |
|
|
bool HasNamedLookupInterceptor(); |
|
|
V8EXPORT bool HasNamedLookupInterceptor(); |
|
|
|
|
|
|
|
|
/** Tests for an index lookup interceptor.*/ |
|
|
/** Tests for an index lookup interceptor.*/ |
|
|
bool HasIndexedLookupInterceptor(); |
|
|
V8EXPORT bool HasIndexedLookupInterceptor(); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Turns on access check on the object if the object is an instance of |
|
|
* Turns on access check on the object if the object is an instance of |
|
|
* a template that has access check callbacks. If an object has no |
|
|
* a template that has access check callbacks. If an object has no |
|
|
* access check info, the object cannot be accessed by anyone. |
|
|
* access check info, the object cannot be accessed by anyone. |
|
|
*/ |
|
|
*/ |
|
|
void TurnOnAccessCheck(); |
|
|
V8EXPORT void TurnOnAccessCheck(); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns the identity hash for this object. The current implemenation uses |
|
|
* Returns the identity hash for this object. The current implemenation uses |
|
@ -1535,7 +1533,7 @@ class V8EXPORT Object : public Value { |
|
|
* The return value will never be 0. Also, it is not guaranteed to be |
|
|
* The return value will never be 0. Also, it is not guaranteed to be |
|
|
* unique. |
|
|
* unique. |
|
|
*/ |
|
|
*/ |
|
|
int GetIdentityHash(); |
|
|
V8EXPORT int GetIdentityHash(); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Access hidden properties on JavaScript objects. These properties are |
|
|
* Access hidden properties on JavaScript objects. These properties are |
|
@ -1543,9 +1541,9 @@ class V8EXPORT Object : public Value { |
|
|
* C++ API. Hidden properties introduced by V8 internally (for example the |
|
|
* C++ API. Hidden properties introduced by V8 internally (for example the |
|
|
* identity hash) are prefixed with "v8::". |
|
|
* identity hash) are prefixed with "v8::". |
|
|
*/ |
|
|
*/ |
|
|
bool SetHiddenValue(Handle<String> key, Handle<Value> value); |
|
|
V8EXPORT bool SetHiddenValue(Handle<String> key, Handle<Value> value); |
|
|
Local<Value> GetHiddenValue(Handle<String> key); |
|
|
V8EXPORT Local<Value> GetHiddenValue(Handle<String> key); |
|
|
bool DeleteHiddenValue(Handle<String> key); |
|
|
V8EXPORT bool DeleteHiddenValue(Handle<String> key); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns true if this is an instance of an api function (one |
|
|
* Returns true if this is an instance of an api function (one |
|
@ -1554,13 +1552,13 @@ class V8EXPORT Object : public Value { |
|
|
* conservative and may return true for objects that haven't actually |
|
|
* conservative and may return true for objects that haven't actually |
|
|
* been modified. |
|
|
* been modified. |
|
|
*/ |
|
|
*/ |
|
|
bool IsDirty(); |
|
|
V8EXPORT bool IsDirty(); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Clone this object with a fast but shallow copy. Values will point |
|
|
* Clone this object with a fast but shallow copy. Values will point |
|
|
* to the same values as the original object. |
|
|
* to the same values as the original object. |
|
|
*/ |
|
|
*/ |
|
|
Local<Object> Clone(); |
|
|
V8EXPORT Local<Object> Clone(); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Set the backing store of the indexed properties to be managed by the |
|
|
* Set the backing store of the indexed properties to be managed by the |
|
@ -1569,7 +1567,7 @@ class V8EXPORT Object : public Value { |
|
|
* Note: The embedding program still owns the data and needs to ensure that |
|
|
* Note: The embedding program still owns the data and needs to ensure that |
|
|
* the backing store is preserved while V8 has a reference. |
|
|
* the backing store is preserved while V8 has a reference. |
|
|
*/ |
|
|
*/ |
|
|
void SetIndexedPropertiesToPixelData(uint8_t* data, int length); |
|
|
V8EXPORT void SetIndexedPropertiesToPixelData(uint8_t* data, int length); |
|
|
bool HasIndexedPropertiesInPixelData(); |
|
|
bool HasIndexedPropertiesInPixelData(); |
|
|
uint8_t* GetIndexedPropertiesPixelData(); |
|
|
uint8_t* GetIndexedPropertiesPixelData(); |
|
|
int GetIndexedPropertiesPixelDataLength(); |
|
|
int GetIndexedPropertiesPixelDataLength(); |
|
@ -1581,7 +1579,8 @@ class V8EXPORT Object : public Value { |
|
|
* Note: The embedding program still owns the data and needs to ensure that |
|
|
* Note: The embedding program still owns the data and needs to ensure that |
|
|
* the backing store is preserved while V8 has a reference. |
|
|
* the backing store is preserved while V8 has a reference. |
|
|
*/ |
|
|
*/ |
|
|
void SetIndexedPropertiesToExternalArrayData(void* data, |
|
|
V8EXPORT void SetIndexedPropertiesToExternalArrayData( |
|
|
|
|
|
void* data, |
|
|
ExternalArrayType array_type, |
|
|
ExternalArrayType array_type, |
|
|
int number_of_elements); |
|
|
int number_of_elements); |
|
|
bool HasIndexedPropertiesInExternalArrayData(); |
|
|
bool HasIndexedPropertiesInExternalArrayData(); |
|
@ -1589,13 +1588,13 @@ class V8EXPORT Object : public Value { |
|
|
ExternalArrayType GetIndexedPropertiesExternalArrayDataType(); |
|
|
ExternalArrayType GetIndexedPropertiesExternalArrayDataType(); |
|
|
int GetIndexedPropertiesExternalArrayDataLength(); |
|
|
int GetIndexedPropertiesExternalArrayDataLength(); |
|
|
|
|
|
|
|
|
static Local<Object> New(); |
|
|
V8EXPORT static Local<Object> New(); |
|
|
static inline Object* Cast(Value* obj); |
|
|
static inline Object* Cast(Value* obj); |
|
|
private: |
|
|
private: |
|
|
Object(); |
|
|
V8EXPORT Object(); |
|
|
static void CheckCast(Value* obj); |
|
|
V8EXPORT static void CheckCast(Value* obj); |
|
|
Local<Value> CheckedGetInternalField(int index); |
|
|
V8EXPORT Local<Value> CheckedGetInternalField(int index); |
|
|
void* SlowGetPointerFromInternalField(int index); |
|
|
V8EXPORT void* SlowGetPointerFromInternalField(int index); |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* If quick access to the internal field is possible this method |
|
|
* If quick access to the internal field is possible this method |
|
@ -1608,20 +1607,20 @@ class V8EXPORT Object : public Value { |
|
|
/**
|
|
|
/**
|
|
|
* An instance of the built-in array constructor (ECMA-262, 15.4.2). |
|
|
* An instance of the built-in array constructor (ECMA-262, 15.4.2). |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Array : public Object { |
|
|
class Array : public Object { |
|
|
public: |
|
|
public: |
|
|
uint32_t Length() const; |
|
|
V8EXPORT uint32_t Length() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Clones an element at index |index|. Returns an empty |
|
|
* Clones an element at index |index|. Returns an empty |
|
|
* handle if cloning fails (for any reason). |
|
|
* handle if cloning fails (for any reason). |
|
|
*/ |
|
|
*/ |
|
|
Local<Object> CloneElementAt(uint32_t index); |
|
|
V8EXPORT Local<Object> CloneElementAt(uint32_t index); |
|
|
|
|
|
|
|
|
static Local<Array> New(int length = 0); |
|
|
V8EXPORT static Local<Array> New(int length = 0); |
|
|
static inline Array* Cast(Value* obj); |
|
|
static inline Array* Cast(Value* obj); |
|
|
private: |
|
|
private: |
|
|
Array(); |
|
|
V8EXPORT Array(); |
|
|
static void CheckCast(Value* obj); |
|
|
static void CheckCast(Value* obj); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -1629,25 +1628,27 @@ class V8EXPORT Array : public Object { |
|
|
/**
|
|
|
/**
|
|
|
* A JavaScript function object (ECMA-262, 15.3). |
|
|
* A JavaScript function object (ECMA-262, 15.3). |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Function : public Object { |
|
|
class Function : public Object { |
|
|
public: |
|
|
public: |
|
|
Local<Object> NewInstance() const; |
|
|
V8EXPORT Local<Object> NewInstance() const; |
|
|
Local<Object> NewInstance(int argc, Handle<Value> argv[]) const; |
|
|
V8EXPORT Local<Object> NewInstance(int argc, Handle<Value> argv[]) const; |
|
|
Local<Value> Call(Handle<Object> recv, int argc, Handle<Value> argv[]); |
|
|
V8EXPORT Local<Value> Call(Handle<Object> recv, |
|
|
void SetName(Handle<String> name); |
|
|
int argc, |
|
|
Handle<Value> GetName() const; |
|
|
Handle<Value> argv[]); |
|
|
|
|
|
V8EXPORT void SetName(Handle<String> name); |
|
|
|
|
|
V8EXPORT Handle<Value> GetName() const; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Returns zero based line number of function body and |
|
|
* Returns zero based line number of function body and |
|
|
* kLineOffsetNotFound if no information available. |
|
|
* kLineOffsetNotFound if no information available. |
|
|
*/ |
|
|
*/ |
|
|
int GetScriptLineNumber() const; |
|
|
V8EXPORT int GetScriptLineNumber() const; |
|
|
ScriptOrigin GetScriptOrigin() const; |
|
|
V8EXPORT ScriptOrigin GetScriptOrigin() const; |
|
|
static inline Function* Cast(Value* obj); |
|
|
static inline Function* Cast(Value* obj); |
|
|
static const int kLineOffsetNotFound; |
|
|
V8EXPORT static const int kLineOffsetNotFound; |
|
|
private: |
|
|
private: |
|
|
Function(); |
|
|
V8EXPORT Function(); |
|
|
static void CheckCast(Value* obj); |
|
|
V8EXPORT static void CheckCast(Value* obj); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1662,19 +1663,19 @@ class V8EXPORT Function : public Object { |
|
|
* value Unwrap should be used, all other operations on that object will lead |
|
|
* value Unwrap should be used, all other operations on that object will lead |
|
|
* to unpredictable results. |
|
|
* to unpredictable results. |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT External : public Value { |
|
|
class External : public Value { |
|
|
public: |
|
|
public: |
|
|
static Local<Value> Wrap(void* data); |
|
|
V8EXPORT static Local<Value> Wrap(void* data); |
|
|
static inline void* Unwrap(Handle<Value> obj); |
|
|
static inline void* Unwrap(Handle<Value> obj); |
|
|
|
|
|
|
|
|
static Local<External> New(void* value); |
|
|
V8EXPORT static Local<External> New(void* value); |
|
|
static inline External* Cast(Value* obj); |
|
|
static inline External* Cast(Value* obj); |
|
|
void* Value() const; |
|
|
V8EXPORT void* Value() const; |
|
|
private: |
|
|
private: |
|
|
External(); |
|
|
V8EXPORT External(); |
|
|
static void CheckCast(v8::Value* obj); |
|
|
V8EXPORT static void CheckCast(v8::Value* obj); |
|
|
static inline void* QuickUnwrap(Handle<v8::Value> obj); |
|
|
static inline void* QuickUnwrap(Handle<v8::Value> obj); |
|
|
static void* FullUnwrap(Handle<v8::Value> obj); |
|
|
V8EXPORT static void* FullUnwrap(Handle<v8::Value> obj); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1704,7 +1705,7 @@ class V8EXPORT Template : public Data { |
|
|
* including the receiver, the number and values of arguments, and |
|
|
* including the receiver, the number and values of arguments, and |
|
|
* the holder of the function. |
|
|
* the holder of the function. |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Arguments { |
|
|
class Arguments { |
|
|
public: |
|
|
public: |
|
|
inline int Length() const; |
|
|
inline int Length() const; |
|
|
inline Local<Value> operator[](int i) const; |
|
|
inline Local<Value> operator[](int i) const; |
|
@ -1714,7 +1715,6 @@ class V8EXPORT Arguments { |
|
|
inline bool IsConstructCall() const; |
|
|
inline bool IsConstructCall() const; |
|
|
inline Local<Value> Data() const; |
|
|
inline Local<Value> Data() const; |
|
|
private: |
|
|
private: |
|
|
Arguments(); |
|
|
|
|
|
friend class ImplementationUtilities; |
|
|
friend class ImplementationUtilities; |
|
|
inline Arguments(Local<Value> data, |
|
|
inline Arguments(Local<Value> data, |
|
|
Local<Object> holder, |
|
|
Local<Object> holder, |
|
@ -3001,7 +3001,7 @@ class V8EXPORT Context { |
|
|
* Stack-allocated class which sets the execution context for all |
|
|
* Stack-allocated class which sets the execution context for all |
|
|
* operations executed within a local scope. |
|
|
* operations executed within a local scope. |
|
|
*/ |
|
|
*/ |
|
|
class V8EXPORT Scope { |
|
|
class Scope { |
|
|
public: |
|
|
public: |
|
|
inline Scope(Handle<Context> context) : context_(context) { |
|
|
inline Scope(Handle<Context> context) : context_(context) { |
|
|
context_->Enter(); |
|
|
context_->Enter(); |
|
@ -3320,6 +3320,17 @@ void Persistent<T>::ClearWeak() { |
|
|
V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); |
|
|
V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Arguments::Arguments(v8::Local<v8::Value> data, |
|
|
|
|
|
v8::Local<v8::Object> holder, |
|
|
|
|
|
v8::Local<v8::Function> callee, |
|
|
|
|
|
bool is_construct_call, |
|
|
|
|
|
void** values, int length) |
|
|
|
|
|
: data_(data), holder_(holder), callee_(callee), |
|
|
|
|
|
is_construct_call_(is_construct_call), |
|
|
|
|
|
values_(values), length_(length) { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Local<Value> Arguments::operator[](int i) const { |
|
|
Local<Value> Arguments::operator[](int i) const { |
|
|
if (i < 0 || length_ <= i) return Local<Value>(*Undefined()); |
|
|
if (i < 0 || length_ <= i) return Local<Value>(*Undefined()); |
|
|
return Local<Value>(reinterpret_cast<Value*>(values_ - i)); |
|
|
return Local<Value>(reinterpret_cast<Value*>(values_ - i)); |
|
@ -3580,7 +3591,6 @@ Local<Object> AccessorInfo::Holder() const { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#undef V8EXPORT |
|
|
#undef V8EXPORT |
|
|
#undef V8EXPORT_INLINE |
|
|
|
|
|
#undef TYPE_CHECK |
|
|
#undef TYPE_CHECK |
|
|
|
|
|
|
|
|
|
|
|
|
|
|