/**
* Returns true if the handle is empty.
*/
- bool IsEmpty() { return val_ == 0; }
+ bool IsEmpty() const { return val_ == 0; }
- T* operator->();
+ T* operator->() const;
- T* operator*();
+ T* operator*() const;
/**
* Sets the handle to be empty. IsEmpty() will then return true.
* to which they refer are identical.
* The handles' references are not checked.
*/
- template <class S> bool operator==(Handle<S> that) {
+ template <class S> bool operator==(Handle<S> that) const {
void** a = reinterpret_cast<void**>(**this);
void** b = reinterpret_cast<void**>(*that);
if (a == 0) return b == 0;
* the objects to which they refer are different.
* The handles' references are not checked.
*/
- template <class S> bool operator!=(Handle<S> that) {
+ template <class S> bool operator!=(Handle<S> that) const {
return !operator==(that);
}
/**
*Checks if the handle holds the only reference to an object.
*/
- bool IsNearDeath();
+ bool IsNearDeath() const;
/**
* Returns true if the handle's reference is weak.
*/
- bool IsWeak();
+ bool IsWeak() const;
private:
friend class ImplementationUtilities;
*/
class EXPORT Message {
public:
- Local<String> Get();
- Local<String> GetSourceLine();
+ Local<String> Get() const;
+ Local<String> GetSourceLine() const;
- Handle<Value> GetScriptResourceName();
+ Handle<Value> GetScriptResourceName() const;
/**
* Returns the number, 1-based, of the line where the error occurred.
*/
- int GetLineNumber();
+ int GetLineNumber() const;
/**
* Returns the index within the script of the first character where
* the error occurred.
*/
- int GetStartPosition();
+ int GetStartPosition() const;
/**
* Returns the index within the script of the last character where
* the error occurred.
*/
- int GetEndPosition();
+ int GetEndPosition() const;
/**
* Returns the index within the line of the first character where
* the error occurred.
*/
- int GetStartColumn();
+ int GetStartColumn() const;
/**
* Returns the index within the line of the last character where
* the error occurred.
*/
- int GetEndColumn();
+ int GetEndColumn() const;
// TODO(1245381): Print to a string instead of on a FILE.
static void PrintCurrentStackTrace(FILE* out);
* Returns true if this value is the undefined value. See ECMA-262
* 4.3.10.
*/
- bool IsUndefined();
+ bool IsUndefined() const;
/**
* Returns true if this value is the null value. See ECMA-262
* 4.3.11.
*/
- bool IsNull();
+ bool IsNull() const;
/**
* Returns true if this value is true.
*/
- bool IsTrue();
+ bool IsTrue() const;
/**
* Returns true if this value is false.
*/
- bool IsFalse();
+ bool IsFalse() const;
/**
* Returns true if this value is an instance of the String type.
* See ECMA-262 8.4.
*/
- bool IsString();
+ bool IsString() const;
/**
* Returns true if this value is a function.
*/
- bool IsFunction();
+ bool IsFunction() const;
/**
* Returns true if this value is an array.
*/
- bool IsArray();
+ bool IsArray() const;
/**
* Returns true if this value is an object.
*/
- bool IsObject();
+ bool IsObject() const;
/**
* Returns true if this value is boolean.
*/
- bool IsBoolean();
+ bool IsBoolean() const;
/**
* Returns true if this value is a number.
*/
- bool IsNumber();
+ bool IsNumber() const;
/**
* Returns true if this value is external.
*/
- bool IsExternal();
+ bool IsExternal() const;
/**
* Returns true if this value is a 32-bit signed integer.
*/
- bool IsInt32();
+ bool IsInt32() const;
/**
* Returns true if this value is a Date.
*/
- bool IsDate();
+ bool IsDate() const;
- Local<Boolean> ToBoolean();
- Local<Number> ToNumber();
- Local<String> ToString();
- Local<String> ToDetailString();
- Local<Object> ToObject();
- Local<Integer> ToInteger();
- Local<Uint32> ToUint32();
- Local<Int32> ToInt32();
+ 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;
/**
* Attempts to convert a string to an array index.
* Returns an empty handle if the conversion fails.
*/
- Local<Uint32> ToArrayIndex();
+ Local<Uint32> ToArrayIndex() const;
- bool BooleanValue();
- double NumberValue();
- int64_t IntegerValue();
- uint32_t Uint32Value();
- int32_t Int32Value();
+ bool BooleanValue() const;
+ double NumberValue() const;
+ int64_t IntegerValue() const;
+ uint32_t Uint32Value() const;
+ int32_t Int32Value() const;
/** JS == */
- bool Equals(Handle<Value> that);
- bool StrictEquals(Handle<Value> that);
+ bool Equals(Handle<Value> that) const;
+ bool StrictEquals(Handle<Value> that) const;
};
*/
class EXPORT Boolean : public Primitive {
public:
- bool Value();
+ bool Value() const;
static inline Handle<Boolean> New(bool value);
};
/**
* Returns the number of characters in this string.
*/
- int Length();
+ int Length() const;
/**
* Returns the number of bytes in the UTF-8 encoded
* representation of this string.
*/
- int Utf8Length();
+ int Utf8Length() const;
/**
* Write the contents of the string to an external buffer.
* \return The number of characters copied to the buffer
* excluding the NULL terminator.
*/
- int Write(uint16_t* buffer, int start = 0, int length = -1); // UTF-16
- int WriteAscii(char* buffer, int start = 0, int length = -1); // ASCII
- int WriteUtf8(char* buffer, int length = -1); // UTF-8
+ int Write(uint16_t* buffer, int start = 0, int length = -1) const; // UTF-16
+ int WriteAscii(char* buffer, int start = 0, int length = -1) const; // ASCII
+ int WriteUtf8(char* buffer, int length = -1) const; // UTF-8
/**
* Returns true if the string is external
*/
- bool IsExternal();
+ bool IsExternal() const;
/**
* Returns true if the string is both external and ascii
*/
- bool IsExternalAscii();
+ bool IsExternalAscii() const;
/**
* An ExternalStringResource is a wrapper around a two-byte string
* buffer that resides outside V8's heap. Implement an
* Get the ExternalStringResource for an external string. Only
* valid if IsExternal() returns true.
*/
- ExternalStringResource* GetExternalStringResource();
+ ExternalStringResource* GetExternalStringResource() const;
/**
* Get the ExternalAsciiStringResource for an external ascii string.
* Only valid if IsExternalAscii() returns true.
*/
- ExternalAsciiStringResource* GetExternalAsciiStringResource();
+ ExternalAsciiStringResource* GetExternalAsciiStringResource() const;
static String* Cast(v8::Value* obj);
*/
class EXPORT Number : public Primitive {
public:
- double Value();
+ double Value() const;
static Local<Number> New(double value);
static Number* Cast(v8::Value* obj);
private:
class EXPORT Integer : public Number {
public:
static Local<Integer> New(int32_t value);
- int64_t Value();
+ int64_t Value() const;
static Integer* Cast(v8::Value* obj);
private:
Integer();
*/
class EXPORT Int32 : public Integer {
public:
- int32_t Value();
+ int32_t Value() const;
private:
Int32();
};
*/
class EXPORT Uint32 : public Integer {
public:
- uint32_t Value();
+ uint32_t Value() const;
private:
Uint32();
};
* A specialization of Value::NumberValue that is more efficient
* because we know the structure of this object.
*/
- double NumberValue();
+ double NumberValue() const;
static Date* Cast(v8::Value* obj);
};
*/
class EXPORT Array : public Object {
public:
- uint32_t Length();
+ uint32_t Length() const;
static Local<Array> New(int length = 0);
static Array* Cast(Value* obj);
*/
class EXPORT Function : public Object {
public:
- Local<Object> NewInstance();
- Local<Object> NewInstance(int argc, Handle<Value> argv[]);
+ Local<Object> NewInstance() const;
+ Local<Object> NewInstance(int argc, Handle<Value> argv[]) const;
Local<Value> Call(Handle<Object> recv, int argc, Handle<Value> argv[]);
void SetName(Handle<String> name);
- Handle<Value> GetName();
+ Handle<Value> GetName() const;
static Function* Cast(Value* obj);
private:
Function();
public:
static Local<External> New(void* value);
static External* Cast(Value* obj);
- void* Value();
+ void* Value() const;
private:
External();
};
template <class T>
-bool Persistent<T>::IsNearDeath() {
+bool Persistent<T>::IsNearDeath() const {
if (this->IsEmpty()) return false;
return V8::IsGlobalNearDeath(reinterpret_cast<void**>(**this));
}
template <class T>
-bool Persistent<T>::IsWeak() {
+bool Persistent<T>::IsWeak() const {
if (this->IsEmpty()) return false;
return V8::IsGlobalWeak(reinterpret_cast<void**>(**this));
}
}
template <class T>
-T* Handle<T>::operator->() {
+T* Handle<T>::operator->() const {
return val_;
}
template <class T>
-T* Handle<T>::operator*() {
+T* Handle<T>::operator*() const {
return val_;
}
}
-static inline bool EmptyCheck(const char* location, v8::Data* obj) {
+static inline bool EmptyCheck(const char* location, const v8::Data* obj) {
return (obj == 0) ? ReportEmptyHandle(location) : false;
}
// --- M e s s a g e ---
-Local<String> Message::Get() {
+Local<String> Message::Get() const {
ON_BAILOUT("v8::Message::Get()", return Local<String>());
HandleScope scope;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-v8::Handle<Value> Message::GetScriptResourceName() {
+v8::Handle<Value> Message::GetScriptResourceName() const {
if (IsDeadCheck("v8::Message::GetScriptResourceName()")) {
return Local<String>();
}
}
-int Message::GetLineNumber() {
+int Message::GetLineNumber() const {
ON_BAILOUT("v8::Message::GetLineNumber()", return -1);
HandleScope scope;
EXCEPTION_PREAMBLE();
}
-int Message::GetStartPosition() {
+int Message::GetStartPosition() const {
if (IsDeadCheck("v8::Message::GetStartPosition()")) return 0;
HandleScope scope;
}
-int Message::GetEndPosition() {
+int Message::GetEndPosition() const {
if (IsDeadCheck("v8::Message::GetEndPosition()")) return 0;
HandleScope scope;
i::Handle<i::JSObject> data_obj = Utils::OpenHandle(this);
}
-int Message::GetStartColumn() {
+int Message::GetStartColumn() const {
if (IsDeadCheck("v8::Message::GetStartColumn()")) return 0;
HandleScope scope;
i::Handle<i::JSObject> data_obj = Utils::OpenHandle(this);
}
-int Message::GetEndColumn() {
+int Message::GetEndColumn() const {
if (IsDeadCheck("v8::Message::GetEndColumn()")) return 0;
HandleScope scope;
i::Handle<i::JSObject> data_obj = Utils::OpenHandle(this);
}
-Local<String> Message::GetSourceLine() {
+Local<String> Message::GetSourceLine() const {
ON_BAILOUT("v8::Message::GetSourceLine()", return Local<String>());
HandleScope scope;
EXCEPTION_PREAMBLE();
// --- D a t a ---
-bool Value::IsUndefined() {
+bool Value::IsUndefined() const {
if (IsDeadCheck("v8::Value::IsUndefined()")) return false;
return Utils::OpenHandle(this)->IsUndefined();
}
-bool Value::IsNull() {
+bool Value::IsNull() const {
if (IsDeadCheck("v8::Value::IsNull()")) return false;
return Utils::OpenHandle(this)->IsNull();
}
-bool Value::IsTrue() {
+bool Value::IsTrue() const {
if (IsDeadCheck("v8::Value::IsTrue()")) return false;
return Utils::OpenHandle(this)->IsTrue();
}
-bool Value::IsFalse() {
+bool Value::IsFalse() const {
if (IsDeadCheck("v8::Value::IsFalse()")) return false;
return Utils::OpenHandle(this)->IsFalse();
}
-bool Value::IsFunction() {
+bool Value::IsFunction() const {
if (IsDeadCheck("v8::Value::IsFunction()")) return false;
return Utils::OpenHandle(this)->IsJSFunction();
}
-bool Value::IsString() {
+bool Value::IsString() const {
if (IsDeadCheck("v8::Value::IsString()")) return false;
return Utils::OpenHandle(this)->IsString();
}
-bool Value::IsArray() {
+bool Value::IsArray() const {
if (IsDeadCheck("v8::Value::IsArray()")) return false;
return Utils::OpenHandle(this)->IsJSArray();
}
-bool Value::IsObject() {
+bool Value::IsObject() const {
if (IsDeadCheck("v8::Value::IsObject()")) return false;
return Utils::OpenHandle(this)->IsJSObject();
}
-bool Value::IsNumber() {
+bool Value::IsNumber() const {
if (IsDeadCheck("v8::Value::IsNumber()")) return false;
return Utils::OpenHandle(this)->IsNumber();
}
-bool Value::IsBoolean() {
+bool Value::IsBoolean() const {
if (IsDeadCheck("v8::Value::IsBoolean()")) return false;
return Utils::OpenHandle(this)->IsBoolean();
}
-bool Value::IsExternal() {
+bool Value::IsExternal() const {
if (IsDeadCheck("v8::Value::IsExternal()")) return false;
return Utils::OpenHandle(this)->IsProxy();
}
-bool Value::IsInt32() {
+bool Value::IsInt32() const {
if (IsDeadCheck("v8::Value::IsInt32()")) return false;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
if (obj->IsSmi()) return true;
}
-bool Value::IsDate() {
+bool Value::IsDate() const {
if (IsDeadCheck("v8::Value::IsDate()")) return false;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
return obj->HasSpecificClassOf(i::Heap::Date_symbol());
}
-Local<String> Value::ToString() {
+Local<String> Value::ToString() const {
if (IsDeadCheck("v8::Value::ToString()")) return Local<String>();
LOG_API("ToString");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-Local<String> Value::ToDetailString() {
+Local<String> Value::ToDetailString() const {
if (IsDeadCheck("v8::Value::ToDetailString()")) return Local<String>();
LOG_API("ToDetailString");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-Local<v8::Object> Value::ToObject() {
+Local<v8::Object> Value::ToObject() const {
if (IsDeadCheck("v8::Value::ToObject()")) return Local<v8::Object>();
LOG_API("ToObject");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-Local<Boolean> Value::ToBoolean() {
+Local<Boolean> Value::ToBoolean() const {
if (IsDeadCheck("v8::Value::ToBoolean()")) return Local<Boolean>();
LOG_API("ToBoolean");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-Local<Number> Value::ToNumber() {
+Local<Number> Value::ToNumber() const {
if (IsDeadCheck("v8::Value::ToNumber()")) return Local<Number>();
LOG_API("ToNumber");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-Local<Integer> Value::ToInteger() {
+Local<Integer> Value::ToInteger() const {
if (IsDeadCheck("v8::Value::ToInteger()")) return Local<Integer>();
LOG_API("ToInteger");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-bool Value::BooleanValue() {
+bool Value::BooleanValue() const {
if (IsDeadCheck("v8::Value::BooleanValue()")) return false;
LOG_API("BooleanValue");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-double Value::NumberValue() {
+double Value::NumberValue() const {
if (IsDeadCheck("v8::Value::NumberValue()")) return i::OS::nan_value();
LOG_API("NumberValue");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-int64_t Value::IntegerValue() {
+int64_t Value::IntegerValue() const {
if (IsDeadCheck("v8::Value::IntegerValue()")) return 0;
LOG_API("IntegerValue");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-Local<Int32> Value::ToInt32() {
+Local<Int32> Value::ToInt32() const {
if (IsDeadCheck("v8::Value::ToInt32()")) return Local<Int32>();
LOG_API("ToInt32");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-Local<Uint32> Value::ToUint32() {
+Local<Uint32> Value::ToUint32() const {
if (IsDeadCheck("v8::Value::ToUint32()")) return Local<Uint32>();
LOG_API("ToUInt32");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-Local<Uint32> Value::ToArrayIndex() {
+Local<Uint32> Value::ToArrayIndex() const {
if (IsDeadCheck("v8::Value::ToArrayIndex()")) return Local<Uint32>();
LOG_API("ToArrayIndex");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-int32_t Value::Int32Value() {
+int32_t Value::Int32Value() const {
if (IsDeadCheck("v8::Value::Int32Value()")) return 0;
LOG_API("Int32Value");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-bool Value::Equals(Handle<Value> that) {
+bool Value::Equals(Handle<Value> that) const {
if (IsDeadCheck("v8::Value::Equals()")
|| EmptyCheck("v8::Value::Equals()", this)
|| EmptyCheck("v8::Value::Equals()", that))
}
-bool Value::StrictEquals(Handle<Value> that) {
+bool Value::StrictEquals(Handle<Value> that) const {
if (IsDeadCheck("v8::Value::StrictEquals()")
|| EmptyCheck("v8::Value::StrictEquals()", this)
|| EmptyCheck("v8::Value::StrictEquals()", that))
}
-uint32_t Value::Uint32Value() {
+uint32_t Value::Uint32Value() const {
if (IsDeadCheck("v8::Value::Uint32Value()")) return 0;
LOG_API("Uint32Value");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-Local<v8::Object> Function::NewInstance() {
+Local<v8::Object> Function::NewInstance() const {
return NewInstance(0, NULL);
}
Local<v8::Object> Function::NewInstance(int argc,
- v8::Handle<v8::Value> argv[]) {
+ v8::Handle<v8::Value> argv[]) const {
ON_BAILOUT("v8::Function::NewInstance()", return Local<v8::Object>());
LOG_API("Function::NewInstance");
HandleScope scope;
}
-Handle<Value> Function::GetName() {
+Handle<Value> Function::GetName() const {
i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
return Utils::ToLocal(i::Handle<i::Object>(func->shared()->name()));
}
-int String::Length() {
+int String::Length() const {
if (IsDeadCheck("v8::String::Length()")) return 0;
return Utils::OpenHandle(this)->length();
}
-int String::Utf8Length() {
+int String::Utf8Length() const {
if (IsDeadCheck("v8::String::Utf8Length()")) return 0;
return Utils::OpenHandle(this)->Utf8Length();
}
-int String::WriteUtf8(char* buffer, int capacity) {
+int String::WriteUtf8(char* buffer, int capacity) const {
if (IsDeadCheck("v8::String::WriteUtf8()")) return 0;
LOG_API("String::WriteUtf8");
i::Handle<i::String> str = Utils::OpenHandle(this);
}
-int String::WriteAscii(char* buffer, int start, int length) {
+int String::WriteAscii(char* buffer, int start, int length) const {
if (IsDeadCheck("v8::String::WriteAscii()")) return 0;
LOG_API("String::WriteAscii");
ASSERT(start >= 0 && length >= -1);
}
-int String::Write(uint16_t* buffer, int start, int length) {
+int String::Write(uint16_t* buffer, int start, int length) const {
if (IsDeadCheck("v8::String::Write()")) return 0;
LOG_API("String::Write");
ASSERT(start >= 0 && length >= -1);
}
-bool v8::String::IsExternal() {
+bool v8::String::IsExternal() const {
EnsureInitialized("v8::String::IsExternal()");
i::Handle<i::String> str = Utils::OpenHandle(this);
i::StringShape shape(*str);
}
-bool v8::String::IsExternalAscii() {
+bool v8::String::IsExternalAscii() const {
EnsureInitialized("v8::String::IsExternalAscii()");
i::Handle<i::String> str = Utils::OpenHandle(this);
i::StringShape shape(*str);
}
-v8::String::ExternalStringResource* v8::String::GetExternalStringResource() {
+v8::String::ExternalStringResource*
+v8::String::GetExternalStringResource() const {
EnsureInitialized("v8::String::GetExternalStringResource()");
i::Handle<i::String> str = Utils::OpenHandle(this);
ASSERT(str->IsExternalTwoByteString());
v8::String::ExternalAsciiStringResource*
- v8::String::GetExternalAsciiStringResource() {
+ v8::String::GetExternalAsciiStringResource() const {
EnsureInitialized("v8::String::GetExternalAsciiStringResource()");
i::Handle<i::String> str = Utils::OpenHandle(this);
ASSERT(str->IsExternalAsciiString());
}
-double Number::Value() {
+double Number::Value() const {
if (IsDeadCheck("v8::Number::Value()")) return 0;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
return obj->Number();
}
-bool Boolean::Value() {
+bool Boolean::Value() const {
if (IsDeadCheck("v8::Boolean::Value()")) return false;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
return obj->IsTrue();
}
-int64_t Integer::Value() {
+int64_t Integer::Value() const {
if (IsDeadCheck("v8::Integer::Value()")) return 0;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
if (obj->IsSmi()) {
}
-int32_t Int32::Value() {
+int32_t Int32::Value() const {
if (IsDeadCheck("v8::Int32::Value()")) return 0;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
if (obj->IsSmi()) {
}
-void* External::Value() {
+void* External::Value() const {
if (IsDeadCheck("v8::External::Value()")) return 0;
i::Handle<i::Object> obj = Utils::OpenHandle(this);
return reinterpret_cast<void*>(i::Proxy::cast(*obj)->proxy());
}
-double v8::Date::NumberValue() {
+double v8::Date::NumberValue() const {
if (IsDeadCheck("v8::Date::NumberValue()")) return 0;
LOG_API("Date::NumberValue");
i::Handle<i::Object> obj = Utils::OpenHandle(this);
}
-uint32_t v8::Array::Length() {
+uint32_t v8::Array::Length() const {
if (IsDeadCheck("v8::Array::Length()")) return 0;
i::Handle<i::JSArray> obj = Utils::OpenHandle(this);
i::Object* length = obj->length();
v8::internal::Handle<v8::internal::TypeSwitchInfo> obj);
static inline v8::internal::Handle<v8::internal::TemplateInfo>
- OpenHandle(Template* that);
+ OpenHandle(const Template* that);
static inline v8::internal::Handle<v8::internal::FunctionTemplateInfo>
- OpenHandle(FunctionTemplate* that);
+ OpenHandle(const FunctionTemplate* that);
static inline v8::internal::Handle<v8::internal::ObjectTemplateInfo>
- OpenHandle(ObjectTemplate* that);
+ OpenHandle(const ObjectTemplate* that);
static inline v8::internal::Handle<v8::internal::Object>
- OpenHandle(Data* data);
+ OpenHandle(const Data* data);
static inline v8::internal::Handle<v8::internal::JSObject>
- OpenHandle(v8::Object* data);
+ OpenHandle(const v8::Object* data);
static inline v8::internal::Handle<v8::internal::JSArray>
- OpenHandle(v8::Array* data);
+ OpenHandle(const v8::Array* data);
static inline v8::internal::Handle<v8::internal::String>
- OpenHandle(String* data);
+ OpenHandle(const String* data);
static inline v8::internal::Handle<v8::internal::JSFunction>
- OpenHandle(Script* data);
+ OpenHandle(const Script* data);
static inline v8::internal::Handle<v8::internal::JSFunction>
- OpenHandle(Function* data);
+ OpenHandle(const Function* data);
static inline v8::internal::Handle<v8::internal::JSObject>
- OpenHandle(Message* message);
+ OpenHandle(const Message* message);
static inline v8::internal::Handle<v8::internal::Context>
- OpenHandle(v8::Context* context);
+ OpenHandle(const v8::Context* context);
static inline v8::internal::Handle<v8::internal::SignatureInfo>
- OpenHandle(v8::Signature* sig);
+ OpenHandle(const v8::Signature* sig);
static inline v8::internal::Handle<v8::internal::TypeSwitchInfo>
- OpenHandle(v8::TypeSwitch* that);
+ OpenHandle(const v8::TypeSwitch* that);
static inline v8::internal::Handle<v8::internal::Proxy>
- OpenHandle(v8::External* that);
+ OpenHandle(const v8::External* that);
};
// Implementations of OpenHandle
#define MAKE_OPEN_HANDLE(From, To) \
- v8::internal::Handle<v8::internal::To> Utils::OpenHandle(v8::From* that) { \
+ v8::internal::Handle<v8::internal::To> Utils::OpenHandle(const v8::From* that) { \
return v8::internal::Handle<v8::internal::To>( \
- reinterpret_cast<v8::internal::To**>(that)); \
+ reinterpret_cast<v8::internal::To**>(const_cast<v8::From*>(that))); \
}
MAKE_OPEN_HANDLE(Template, TemplateInfo)