diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-07-21 22:20:37 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-07-21 22:20:37 -0700 |
commit | f319e126218dcaafdb0ccf7e968ff839f8327bba (patch) | |
tree | 209546d94cdc6c19f69ef92e3ec057301369f416 /deps/v8/include | |
parent | ef1be160d66b7da8bc2da857b1c33c6f680d86f1 (diff) | |
download | nodejs-f319e126218dcaafdb0ccf7e968ff839f8327bba.tar.gz nodejs-f319e126218dcaafdb0ccf7e968ff839f8327bba.tar.bz2 nodejs-f319e126218dcaafdb0ccf7e968ff839f8327bba.zip |
Upgrade V8 to 3.4.14
Diffstat (limited to 'deps/v8/include')
-rw-r--r-- | deps/v8/include/v8.h | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 087241106..f4f81e4c7 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -80,9 +80,11 @@ namespace v8 { class Context; class String; +class StringObject; class Value; class Utils; class Number; +class NumberObject; class Object; class Array; class Int32; @@ -90,6 +92,7 @@ class Uint32; class External; class Primitive; class Boolean; +class BooleanObject; class Integer; class Function; class Date; @@ -929,6 +932,26 @@ class Value : public Data { 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. */ V8EXPORT bool IsRegExp() const; @@ -1435,6 +1458,13 @@ class Object : public Value { V8EXPORT Local<Value> Get(uint32_t index); + /** + * Gets the property attributes of a property which can be None or + * any combination of ReadOnly, DontEnum and DontDelete. Returns + * None when the property doesn't exist. + */ + V8EXPORT PropertyAttribute GetPropertyAttributes(Handle<Value> key); + // TODO(1245389): Replace the type-specific versions of these // functions with generic ones that accept a Handle<Value> key. V8EXPORT bool Has(Handle<String> key); @@ -1745,6 +1775,63 @@ class Date : public Object { /** + * 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). */ class RegExp : public Object { @@ -2721,6 +2808,13 @@ class V8EXPORT StartupDataDecompressor { // NOLINT 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. */ @@ -2946,6 +3040,12 @@ class V8EXPORT V8 { 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 * V8 an indication of the amount of externally allocated memory * that is kept alive by JavaScript objects. V8 uses this to decide @@ -4010,6 +4110,30 @@ Date* Date::Cast(v8::Value* 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) { #ifdef V8_ENABLE_CHECKS CheckCast(value); |