Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index 44a74ed5fea97282ce307cafd3d88df161da1adc..299472a04fc1c48390ff4d88f60b3cf31ea84dc2 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -114,6 +114,7 @@ class String; |
class StringObject; |
class Symbol; |
class SymbolObject; |
+class Private; |
class Uint32; |
class Utils; |
class Value; |
@@ -1926,11 +1927,9 @@ class V8_EXPORT Symbol : public Primitive { |
// Returns the print name string of the symbol, or undefined if none. |
Local<Value> Name() const; |
- // Create a symbol without a print name. |
- static Local<Symbol> New(Isolate* isolate); |
- |
- // Create a symbol with a print name. |
- static Local<Symbol> New(Isolate *isolate, const char* data, int length = -1); |
+ // Create a symbol. If data is not NULL, it will be used as a print name. |
+ static Local<Symbol> New( |
+ Isolate *isolate, const char* data = NULL, int length = -1); |
V8_INLINE static Symbol* Cast(v8::Value* obj); |
private: |
@@ -1940,6 +1939,25 @@ class V8_EXPORT Symbol : public Primitive { |
/** |
+ * A private symbol |
+ * |
+ * This is an experimental feature. Use at your own risk. |
+ */ |
+class V8_EXPORT Private : public Data { |
+ public: |
+ // Returns the print name string of the private symbol, or undefined if none. |
+ Local<Value> Name() const; |
+ |
+ // Create a private symbol. If data is not NULL, it will be the print name. |
+ static Local<Private> New( |
+ Isolate *isolate, const char* data = NULL, int length = -1); |
+ |
+ private: |
+ Private(); |
+}; |
+ |
+ |
+/** |
* A JavaScript number value (ECMA-262, 4.3.20) |
*/ |
class V8_EXPORT Number : public Primitive { |
@@ -2109,6 +2127,17 @@ class V8_EXPORT Object : public Value { |
AccessControl settings = DEFAULT); |
/** |
+ * Functionality for private properties. |
+ * This is an experimental feature, use at your own risk. |
+ * Note: Private properties are inherited. Do not rely on this, since it may |
+ * change. |
+ */ |
+ bool HasPrivate(Handle<Private> key); |
+ bool SetPrivate(Handle<Private> key, Handle<Value> value); |
+ bool DeletePrivate(Handle<Private> key); |
+ Local<Value> GetPrivate(Handle<Private> key); |
+ |
+ /** |
* Returns an array containing the names of the enumerable properties |
* of this object, including properties from prototype objects. The |
* array returned by this method contains the same values as would |