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

Unified Diff: test/cctest/test-api.cc

Issue 240113010: Tighten OpenHandle's extra checks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase Created 6 years, 8 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 | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index e346df265d798d5c87541f8df4c3e74c37a22699..6148dc3bced15e32ccf2ba8aeeade07f2b0a5dd8 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -1917,14 +1917,14 @@ static void EchoNamedProperty(Local<String> name,
void SimpleAccessorGetter(Local<String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- Handle<Object> self = info.This();
+ Handle<Object> self = Handle<Object>::Cast(info.This());
info.GetReturnValue().Set(
self->Get(String::Concat(v8_str("accessor_"), name)));
}
void SimpleAccessorSetter(Local<String> name, Local<Value> value,
const v8::PropertyCallbackInfo<void>& info) {
- Handle<Object> self = info.This();
+ Handle<Object> self = Handle<Object>::Cast(info.This());
self->Set(String::Concat(v8_str("accessor_"), name), value);
}
@@ -1947,7 +1947,7 @@ void InterceptorGetter(Local<String> name,
for (i = 0; name_str[i] && prefix[i]; ++i) {
if (name_str[i] != prefix[i]) return;
}
- Handle<Object> self = info.This();
+ Handle<Object> self = Handle<Object>::Cast(info.This());
info.GetReturnValue().Set(self->GetHiddenValue(v8_str(name_str + i)));
}
@@ -1966,7 +1966,7 @@ void InterceptorSetter(Local<String> name,
if (!prefix[i]) return;
if (value->IsInt32() && value->Int32Value() < 10000) {
- Handle<Object> self = info.This();
+ Handle<Object> self = Handle<Object>::Cast(info.This());
self->SetHiddenValue(name, value);
info.GetReturnValue().Set(value);
}
@@ -8205,10 +8205,9 @@ static void YGetter(Local<String> name,
static void YSetter(Local<String> name,
Local<Value> value,
const v8::PropertyCallbackInfo<void>& info) {
- if (info.This()->Has(name)) {
- info.This()->Delete(name);
- }
- info.This()->Set(name, value);
+ Local<Object> this_obj = Local<Object>::Cast(info.This());
+ if (this_obj->Has(name)) this_obj->Delete(name);
+ this_obj->Set(name, value);
}
@@ -11458,7 +11457,7 @@ THREADED_TEST(InterceptorLoadICInvalidatedFieldViaGlobal) {
static void SetOnThis(Local<String> name,
Local<Value> value,
const v8::PropertyCallbackInfo<void>& info) {
- info.This()->ForceSet(name, value);
+ Local<Object>::Cast(info.This())->ForceSet(name, value);
}
@@ -18545,7 +18544,7 @@ static void SetterWhichSetsYOnThisTo23(
const v8::PropertyCallbackInfo<void>& info) {
CHECK(v8::Utils::OpenHandle(*info.This())->IsJSObject());
CHECK(v8::Utils::OpenHandle(*info.Holder())->IsJSObject());
- info.This()->Set(v8_str("y"), v8_num(23));
+ Local<Object>::Cast(info.This())->Set(v8_str("y"), v8_num(23));
}
@@ -18564,7 +18563,7 @@ void FooSetInterceptor(Local<String> name,
CHECK(v8::Utils::OpenHandle(*info.This())->IsJSObject());
CHECK(v8::Utils::OpenHandle(*info.Holder())->IsJSObject());
if (!name->Equals(v8_str("foo"))) return;
- info.This()->Set(v8_str("y"), v8_num(23));
+ Local<Object>::Cast(info.This())->Set(v8_str("y"), v8_num(23));
info.GetReturnValue().Set(v8_num(23));
}
@@ -18617,7 +18616,7 @@ static void NamedPropertySetterWhichSetsYOnThisTo23(
Local<Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info) {
if (name->Equals(v8_str("x"))) {
- info.This()->Set(v8_str("y"), v8_num(23));
+ Local<Object>::Cast(info.This())->Set(v8_str("y"), v8_num(23));
}
}
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698