Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: include/v8.h

Issue 639123009: Classes: Add basic support for properties (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/standalone.gypi ('k') | include/v8config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index a191c07d24f3d6677faa82178791265c6cd78d0a..f70f45769bb5ca58ff6d178b7129f92448301e8c 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -15,7 +15,11 @@
#ifndef V8_H_
#define V8_H_
-#include "v8stdint.h"
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#include "v8config.h"
// We reserve the V8_* prefix for macros defined in V8 public API and
// assume there are no name conflicts with the embedder's code.
@@ -1699,14 +1703,24 @@ class V8_EXPORT Value : public Data {
*/
bool IsDataView() const;
- Local<Boolean> ToBoolean() const;
- Local<Number> ToNumber() const;
- Local<String> ToString() const;
- Local<String> ToDetailString() const;
- Local<Object> ToObject() const;
- Local<Integer> ToInteger() const;
- Local<Uint32> ToUint32() const;
- Local<Int32> ToInt32() const;
+ Local<Boolean> ToBoolean(Isolate* isolate) const;
+ Local<Number> ToNumber(Isolate* isolate) const;
+ Local<String> ToString(Isolate* isolate) const;
+ Local<String> ToDetailString(Isolate* isolate) const;
+ Local<Object> ToObject(Isolate* isolate) const;
+ Local<Integer> ToInteger(Isolate* isolate) const;
+ Local<Uint32> ToUint32(Isolate* isolate) const;
+ Local<Int32> ToInt32(Isolate* isolate) const;
+
+ // TODO(dcarney): deprecate all these.
+ inline Local<Boolean> ToBoolean() const;
+ inline Local<Number> ToNumber() const;
+ inline Local<String> ToString() const;
+ inline Local<String> ToDetailString() const;
+ inline Local<Object> ToObject() const;
+ inline Local<Integer> ToInteger() const;
+ inline Local<Uint32> ToUint32() const;
+ inline Local<Int32> ToInt32() const;
/**
* Attempts to convert a string to an array index.
@@ -1773,7 +1787,6 @@ class V8_EXPORT String : public Name {
enum Encoding {
UNKNOWN_ENCODING = 0x1,
TWO_BYTE_ENCODING = 0x0,
- ASCII_ENCODING = 0x4, // TODO(yangguo): deprecate this.
ONE_BYTE_ENCODING = 0x4
};
/**
@@ -1829,7 +1842,6 @@ class V8_EXPORT String : public Name {
NO_OPTIONS = 0,
HINT_MANY_WRITES_EXPECTED = 1,
NO_NULL_TERMINATION = 2,
- PRESERVE_ASCII_NULL = 4, // TODO(yangguo): deprecate this.
PRESERVE_ONE_BYTE_NULL = 4,
// Used by WriteUtf8 to replace orphan surrogate code units with the
// unicode replacement character. Needs to be set to guarantee valid UTF-8
@@ -1868,9 +1880,6 @@ class V8_EXPORT String : public Name {
*/
bool IsExternalOneByte() const;
- // TODO(yangguo): deprecate this.
- bool IsExternalAscii() const { return IsExternalOneByte(); }
-
class V8_EXPORT ExternalStringResourceBase { // NOLINT
public:
virtual ~ExternalStringResourceBase() {}
@@ -1949,8 +1958,6 @@ class V8_EXPORT String : public Name {
ExternalOneByteStringResource() {}
};
- typedef ExternalOneByteStringResource ExternalAsciiStringResource;
-
/**
* If the string is an external string, return the ExternalStringResourceBase
* regardless of the encoding, otherwise return NULL. The encoding of the
@@ -1971,11 +1978,6 @@ class V8_EXPORT String : public Name {
*/
const ExternalOneByteStringResource* GetExternalOneByteStringResource() const;
- // TODO(yangguo): deprecate this.
- const ExternalAsciiStringResource* GetExternalAsciiStringResource() const {
- return GetExternalOneByteStringResource();
- }
-
V8_INLINE static String* Cast(v8::Value* obj);
enum NewStringType {
@@ -2138,6 +2140,7 @@ class V8_EXPORT Symbol : public Name {
// Well-known symbols
static Local<Symbol> GetIterator(Isolate* isolate);
static Local<Symbol> GetUnscopables(Isolate* isolate);
+ static Local<Symbol> GetToStringTag(Isolate* isolate);
V8_INLINE static Symbol* Cast(v8::Value* obj);
@@ -2515,15 +2518,6 @@ class V8_EXPORT Object : public Value {
bool DeleteHiddenValue(Handle<String> key);
/**
- * Returns true if this is an instance of an api function (one
- * created from a function created from a function template) and has
- * been modified since it was created. Note that this method is
- * conservative and may return true for objects that haven't actually
- * been modified.
- */
- bool IsDirty();
-
- /**
* Clone this object with a fast but shallow copy. Values will point
* to the same values as the original object.
*/
@@ -6654,6 +6648,44 @@ template <class T> Value* Value::Cast(T* value) {
}
+Local<Boolean> Value::ToBoolean() const {
+ return ToBoolean(Isolate::GetCurrent());
+}
+
+
+Local<Number> Value::ToNumber() const {
+ return ToNumber(Isolate::GetCurrent());
+}
+
+
+Local<String> Value::ToString() const {
+ return ToString(Isolate::GetCurrent());
+}
+
+
+Local<String> Value::ToDetailString() const {
+ return ToDetailString(Isolate::GetCurrent());
+}
+
+
+Local<Object> Value::ToObject() const {
+ return ToObject(Isolate::GetCurrent());
+}
+
+
+Local<Integer> Value::ToInteger() const {
+ return ToInteger(Isolate::GetCurrent());
+}
+
+
+Local<Uint32> Value::ToUint32() const {
+ return ToUint32(Isolate::GetCurrent());
+}
+
+
+Local<Int32> Value::ToInt32() const { return ToInt32(Isolate::GetCurrent()); }
+
+
Name* Name::Cast(v8::Value* value) {
#ifdef V8_ENABLE_CHECKS
CheckCast(value);
« no previous file with comments | « build/standalone.gypi ('k') | include/v8config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698