| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index cc9cd3ae9f60820190948cf403fda7f349a9d9cb..ac9a4894ff5a5da445fb22fac9cce1f826e22466 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -1192,14 +1192,14 @@ static i::Handle<i::AccessorInfo> MakeAccessorInfo(
|
|
|
|
|
| Local<ObjectTemplate> FunctionTemplate::InstanceTemplate() {
|
| - i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
|
| - if (!Utils::ApiCheck(this != NULL,
|
| + i::Handle<i::FunctionTemplateInfo> handle = Utils::OpenHandle(this, true);
|
| + if (!Utils::ApiCheck(!handle.is_null(),
|
| "v8::FunctionTemplate::InstanceTemplate()",
|
| "Reading from empty handle")) {
|
| return Local<ObjectTemplate>();
|
| }
|
| + i::Isolate* isolate = handle->GetIsolate();
|
| ENTER_V8(isolate);
|
| - i::Handle<i::FunctionTemplateInfo> handle = Utils::OpenHandle(this);
|
| if (handle->instance_template()->IsUndefined()) {
|
| Local<ObjectTemplate> templ =
|
| ObjectTemplate::New(isolate, ToApiHandle<FunctionTemplate>(handle));
|
| @@ -1616,11 +1616,11 @@ Handle<Value> UnboundScript::GetScriptName() {
|
|
|
|
|
| Local<Value> Script::Run() {
|
| + i::Handle<i::HeapObject> obj =
|
| + i::Handle<i::HeapObject>::cast(Utils::OpenHandle(this, true));
|
| // If execution is terminating, Compile(..)->Run() requires this
|
| // check.
|
| - if (this == NULL) return Local<Value>();
|
| - i::Handle<i::HeapObject> obj =
|
| - i::Handle<i::HeapObject>::cast(Utils::OpenHandle(this));
|
| + if (obj.is_null()) return Local<Value>();
|
| i::Isolate* isolate = obj->GetIsolate();
|
| ON_BAILOUT(isolate, "v8::Script::Run()", return Local<Value>());
|
| LOG_API(isolate, "Script::Run");
|
| @@ -2912,14 +2912,14 @@ int32_t Value::Int32Value() const {
|
|
|
| bool Value::Equals(Handle<Value> that) const {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| - if (!Utils::ApiCheck(this != NULL && !that.IsEmpty(),
|
| + i::Handle<i::Object> obj = Utils::OpenHandle(this, true);
|
| + if (!Utils::ApiCheck(!obj.is_null() && !that.IsEmpty(),
|
| "v8::Value::Equals()",
|
| "Reading from empty handle")) {
|
| return false;
|
| }
|
| LOG_API(isolate, "Equals");
|
| ENTER_V8(isolate);
|
| - i::Handle<i::Object> obj = Utils::OpenHandle(this);
|
| i::Handle<i::Object> other = Utils::OpenHandle(*that);
|
| // If both obj and other are JSObjects, we'd better compare by identity
|
| // immediately when going into JS builtin. The reason is Invoke
|
| @@ -2939,13 +2939,13 @@ bool Value::Equals(Handle<Value> that) const {
|
|
|
| bool Value::StrictEquals(Handle<Value> that) const {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| - if (!Utils::ApiCheck(this != NULL && !that.IsEmpty(),
|
| + i::Handle<i::Object> obj = Utils::OpenHandle(this, true);
|
| + if (!Utils::ApiCheck(!obj.is_null() && !that.IsEmpty(),
|
| "v8::Value::StrictEquals()",
|
| "Reading from empty handle")) {
|
| return false;
|
| }
|
| LOG_API(isolate, "StrictEquals");
|
| - i::Handle<i::Object> obj = Utils::OpenHandle(this);
|
| i::Handle<i::Object> other = Utils::OpenHandle(*that);
|
| // Must check HeapNumber first, since NaN !== NaN.
|
| if (obj->IsHeapNumber()) {
|
| @@ -2971,12 +2971,12 @@ bool Value::StrictEquals(Handle<Value> that) const {
|
|
|
|
|
| bool Value::SameValue(Handle<Value> that) const {
|
| - if (!Utils::ApiCheck(this != NULL && !that.IsEmpty(),
|
| + i::Handle<i::Object> obj = Utils::OpenHandle(this, true);
|
| + if (!Utils::ApiCheck(!obj.is_null() && !that.IsEmpty(),
|
| "v8::Value::SameValue()",
|
| "Reading from empty handle")) {
|
| return false;
|
| }
|
| - i::Handle<i::Object> obj = Utils::OpenHandle(this);
|
| i::Handle<i::Object> other = Utils::OpenHandle(*that);
|
| return obj->SameValue(*other);
|
| }
|
|
|