v8.h | v8.h | |||
---|---|---|---|---|
skipping to change at line 83 | skipping to change at line 83 | |||
#endif // _WIN32 | #endif // _WIN32 | |||
/** | /** | |||
* The v8 JavaScript engine. | * The v8 JavaScript engine. | |||
*/ | */ | |||
namespace v8 { | namespace v8 { | |||
class Context; | class Context; | |||
class String; | class String; | |||
class StringObject; | ||||
class Value; | class Value; | |||
class Utils; | class Utils; | |||
class Number; | class Number; | |||
class NumberObject; | ||||
class Object; | class Object; | |||
class Array; | class Array; | |||
class Int32; | class Int32; | |||
class Uint32; | class Uint32; | |||
class External; | class External; | |||
class Primitive; | class Primitive; | |||
class Boolean; | class Boolean; | |||
class BooleanObject; | ||||
class Integer; | class Integer; | |||
class Function; | class Function; | |||
class Date; | class Date; | |||
class ImplementationUtilities; | class ImplementationUtilities; | |||
class Signature; | class Signature; | |||
template <class T> class Handle; | template <class T> class Handle; | |||
template <class T> class Local; | template <class T> class Local; | |||
template <class T> class Persistent; | template <class T> class Persistent; | |||
class FunctionTemplate; | class FunctionTemplate; | |||
class ObjectTemplate; | class ObjectTemplate; | |||
skipping to change at line 916 | skipping to change at line 919 | |||
* Returns true if this value is a 32-bit unsigned integer. | * Returns true if this value is a 32-bit unsigned integer. | |||
*/ | */ | |||
V8EXPORT bool IsUint32() const; | V8EXPORT bool IsUint32() const; | |||
/** | /** | |||
* Returns true if this value is a Date. | * Returns true if this value is a Date. | |||
*/ | */ | |||
V8EXPORT bool IsDate() const; | V8EXPORT bool IsDate() const; | |||
/** | /** | |||
* Returns true if this value is a Boolean object. | ||||
*/ | ||||
V8EXPORT bool IsBooleanObject() const; | ||||
/** | ||||
* Returns true if this value is a Number object. | ||||
*/ | ||||
V8EXPORT bool IsNumberObject() const; | ||||
/** | ||||
* Returns true if this value is a String object. | ||||
*/ | ||||
V8EXPORT bool IsStringObject() const; | ||||
/** | ||||
* Returns true if this value is a NativeError. | ||||
*/ | ||||
V8EXPORT bool IsNativeError() const; | ||||
/** | ||||
* Returns true if this value is a RegExp. | * Returns true if this value is a RegExp. | |||
*/ | */ | |||
V8EXPORT bool IsRegExp() const; | V8EXPORT bool IsRegExp() const; | |||
V8EXPORT Local<Boolean> ToBoolean() const; | V8EXPORT Local<Boolean> ToBoolean() const; | |||
V8EXPORT Local<Number> ToNumber() const; | V8EXPORT Local<Number> ToNumber() const; | |||
V8EXPORT Local<String> ToString() const; | V8EXPORT Local<String> ToString() const; | |||
V8EXPORT Local<String> ToDetailString() const; | V8EXPORT Local<String> ToDetailString() const; | |||
V8EXPORT Local<Object> ToObject() const; | V8EXPORT Local<Object> ToObject() const; | |||
V8EXPORT Local<Integer> ToInteger() const; | V8EXPORT Local<Integer> ToInteger() const; | |||
skipping to change at line 1717 | skipping to change at line 1740 | |||
* This API should not be called more than needed as it will | * This API should not be called more than needed as it will | |||
* negatively impact the performance of date operations. | * negatively impact the performance of date operations. | |||
*/ | */ | |||
V8EXPORT static void DateTimeConfigurationChangeNotification(); | V8EXPORT static void DateTimeConfigurationChangeNotification(); | |||
private: | private: | |||
V8EXPORT static void CheckCast(v8::Value* obj); | V8EXPORT static void CheckCast(v8::Value* obj); | |||
}; | }; | |||
/** | /** | |||
* A Number object (ECMA-262, 4.3.21). | ||||
*/ | ||||
class NumberObject : public Object { | ||||
public: | ||||
V8EXPORT static Local<Value> New(double value); | ||||
/** | ||||
* Returns the Number held by the object. | ||||
*/ | ||||
V8EXPORT double NumberValue() const; | ||||
static inline NumberObject* Cast(v8::Value* obj); | ||||
private: | ||||
V8EXPORT static void CheckCast(v8::Value* obj); | ||||
}; | ||||
/** | ||||
* A Boolean object (ECMA-262, 4.3.15). | ||||
*/ | ||||
class BooleanObject : public Object { | ||||
public: | ||||
V8EXPORT static Local<Value> New(bool value); | ||||
/** | ||||
* Returns the Boolean held by the object. | ||||
*/ | ||||
V8EXPORT bool BooleanValue() const; | ||||
static inline BooleanObject* Cast(v8::Value* obj); | ||||
private: | ||||
V8EXPORT static void CheckCast(v8::Value* obj); | ||||
}; | ||||
/** | ||||
* A String object (ECMA-262, 4.3.18). | ||||
*/ | ||||
class StringObject : public Object { | ||||
public: | ||||
V8EXPORT static Local<Value> New(Handle<String> value); | ||||
/** | ||||
* Returns the String held by the object. | ||||
*/ | ||||
V8EXPORT Local<String> StringValue() const; | ||||
static inline StringObject* Cast(v8::Value* obj); | ||||
private: | ||||
V8EXPORT static void CheckCast(v8::Value* obj); | ||||
}; | ||||
/** | ||||
* An instance of the built-in RegExp constructor (ECMA-262, 15.10). | * An instance of the built-in RegExp constructor (ECMA-262, 15.10). | |||
*/ | */ | |||
class RegExp : public Object { | class RegExp : public Object { | |||
public: | public: | |||
/** | /** | |||
* Regular expression flag bits. They can be or'ed to enable a set | * Regular expression flag bits. They can be or'ed to enable a set | |||
* of flags. | * of flags. | |||
*/ | */ | |||
enum Flags { | enum Flags { | |||
kNone = 0, | kNone = 0, | |||
skipping to change at line 2658 | skipping to change at line 2735 | |||
virtual int DecompressData(char* raw_data, | virtual int DecompressData(char* raw_data, | |||
int* raw_data_size, | int* raw_data_size, | |||
const char* compressed_data, | const char* compressed_data, | |||
int compressed_data_size) = 0; | int compressed_data_size) = 0; | |||
private: | private: | |||
char** raw_data; | char** raw_data; | |||
}; | }; | |||
/** | /** | |||
* EntropySource is used as a callback function when v8 needs a source | ||||
* of entropy. | ||||
*/ | ||||
typedef bool (*EntropySource)(unsigned char* buffer, size_t length); | ||||
/** | ||||
* Container class for static utility functions. | * Container class for static utility functions. | |||
*/ | */ | |||
class V8EXPORT V8 { | class V8EXPORT V8 { | |||
public: | public: | |||
/** Set the callback to invoke in case of fatal errors. */ | /** Set the callback to invoke in case of fatal errors. */ | |||
static void SetFatalErrorHandler(FatalErrorCallback that); | static void SetFatalErrorHandler(FatalErrorCallback that); | |||
/** | /** | |||
* Set the callback to invoke to check if code generation from | * Set the callback to invoke to check if code generation from | |||
* strings should be allowed. | * strings should be allowed. | |||
skipping to change at line 2882 | skipping to change at line 2965 | |||
size_t length); | size_t length); | |||
/** | /** | |||
* Initializes from snapshot if possible. Otherwise, attempts to | * Initializes from snapshot if possible. Otherwise, attempts to | |||
* initialize from scratch. This function is called implicitly if | * initialize from scratch. This function is called implicitly if | |||
* you use the API without calling it first. | * you use the API without calling it first. | |||
*/ | */ | |||
static bool Initialize(); | static bool Initialize(); | |||
/** | /** | |||
* Allows the host application to provide a callback which can be used | ||||
* as a source of entropy for random number generators. | ||||
*/ | ||||
static void SetEntropySource(EntropySource source); | ||||
/** | ||||
* Adjusts the amount of registered external memory. Used to give | * Adjusts the amount of registered external memory. Used to give | |||
* V8 an indication of the amount of externally allocated memory | * V8 an indication of the amount of externally allocated memory | |||
* that is kept alive by JavaScript objects. V8 uses this to decide | * that is kept alive by JavaScript objects. V8 uses this to decide | |||
* when to perform global garbage collections. Registering | * when to perform global garbage collections. Registering | |||
* externally allocated memory will trigger global garbage | * externally allocated memory will trigger global garbage | |||
* collections more often than otherwise in an attempt to garbage | * collections more often than otherwise in an attempt to garbage | |||
* collect the JavaScript objects keeping the externally allocated | * collect the JavaScript objects keeping the externally allocated | |||
* memory alive. | * memory alive. | |||
* | * | |||
* \param change_in_bytes the change in externally allocated memory | * \param change_in_bytes the change in externally allocated memory | |||
skipping to change at line 3904 | skipping to change at line 3993 | |||
return static_cast<Integer*>(value); | return static_cast<Integer*>(value); | |||
} | } | |||
Date* Date::Cast(v8::Value* value) { | Date* Date::Cast(v8::Value* value) { | |||
#ifdef V8_ENABLE_CHECKS | #ifdef V8_ENABLE_CHECKS | |||
CheckCast(value); | CheckCast(value); | |||
#endif | #endif | |||
return static_cast<Date*>(value); | return static_cast<Date*>(value); | |||
} | } | |||
StringObject* StringObject::Cast(v8::Value* value) { | ||||
#ifdef V8_ENABLE_CHECKS | ||||
CheckCast(value); | ||||
#endif | ||||
return static_cast<StringObject*>(value); | ||||
} | ||||
NumberObject* NumberObject::Cast(v8::Value* value) { | ||||
#ifdef V8_ENABLE_CHECKS | ||||
CheckCast(value); | ||||
#endif | ||||
return static_cast<NumberObject*>(value); | ||||
} | ||||
BooleanObject* BooleanObject::Cast(v8::Value* value) { | ||||
#ifdef V8_ENABLE_CHECKS | ||||
CheckCast(value); | ||||
#endif | ||||
return static_cast<BooleanObject*>(value); | ||||
} | ||||
RegExp* RegExp::Cast(v8::Value* value) { | RegExp* RegExp::Cast(v8::Value* value) { | |||
#ifdef V8_ENABLE_CHECKS | #ifdef V8_ENABLE_CHECKS | |||
CheckCast(value); | CheckCast(value); | |||
#endif | #endif | |||
return static_cast<RegExp*>(value); | return static_cast<RegExp*>(value); | |||
} | } | |||
Object* Object::Cast(v8::Value* value) { | Object* Object::Cast(v8::Value* value) { | |||
#ifdef V8_ENABLE_CHECKS | #ifdef V8_ENABLE_CHECKS | |||
CheckCast(value); | CheckCast(value); | |||
End of changes. 8 change blocks. | ||||
0 lines changed or deleted | 110 lines changed or added | |||