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

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

Issue 15817014: remove most uses of raw handle constructors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: stupid cast needed Created 7 years, 6 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 | « test/cctest/test-serialize.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-weaktypedarrays.cc
diff --git a/test/cctest/test-weaktypedarrays.cc b/test/cctest/test-weaktypedarrays.cc
index ead5734553cfc2fb2cd172e61356fece5eeb5541..f2f616111b1e6560911ad453eb45ac2df5195aa4 100644
--- a/test/cctest/test-weaktypedarrays.cc
+++ b/test/cctest/test-weaktypedarrays.cc
@@ -137,12 +137,12 @@ TEST(WeakArrayBuffersFromScript) {
CompileRun("var ab1 = new ArrayBuffer(256);"
"var ab2 = new ArrayBuffer(256);"
"var ab3 = new ArrayBuffer(256);");
- v8::Handle<v8::ArrayBuffer> ab1(
- v8::ArrayBuffer::Cast(*CompileRun("ab1")));
- v8::Handle<v8::ArrayBuffer> ab2(
- v8::ArrayBuffer::Cast(*CompileRun("ab2")));
- v8::Handle<v8::ArrayBuffer> ab3(
- v8::ArrayBuffer::Cast(*CompileRun("ab3")));
+ v8::Handle<v8::ArrayBuffer> ab1 =
+ v8::Handle<v8::ArrayBuffer>::Cast(CompileRun("ab1"));
+ v8::Handle<v8::ArrayBuffer> ab2 =
+ v8::Handle<v8::ArrayBuffer>::Cast(CompileRun("ab2"));
+ v8::Handle<v8::ArrayBuffer> ab3 =
+ v8::Handle<v8::ArrayBuffer>::Cast(CompileRun("ab3"));
CHECK_EQ(3, CountArrayBuffersInWeakList(isolate->heap()));
CHECK(HasArrayBufferInWeakList(isolate->heap(),
@@ -166,8 +166,8 @@ TEST(WeakArrayBuffersFromScript) {
for (int j = 1; j <= 3; j++) {
if (j == i) continue;
i::OS::SNPrintF(source, "ab%d", j);
- v8::Handle<v8::ArrayBuffer> ab(
- v8::ArrayBuffer::Cast(*CompileRun(source.start())));
+ v8::Handle<v8::ArrayBuffer> ab =
+ v8::Handle<v8::ArrayBuffer>::Cast(CompileRun(source.start()));
CHECK(HasArrayBufferInWeakList(isolate->heap(),
*v8::Utils::OpenHandle(*ab)));
}
@@ -285,10 +285,14 @@ static void TestTypedArrayFromScript(const char* constructor) {
constructor, constructor, constructor);
CompileRun(source.start());
- v8::Handle<v8::ArrayBuffer> ab(v8::ArrayBuffer::Cast(*CompileRun("ab")));
- v8::Handle<TypedArray> ta1(TypedArray::Cast(*CompileRun("ta1")));
- v8::Handle<TypedArray> ta2(TypedArray::Cast(*CompileRun("ta2")));
- v8::Handle<TypedArray> ta3(TypedArray::Cast(*CompileRun("ta3")));
+ v8::Handle<v8::ArrayBuffer> ab =
+ v8::Handle<v8::ArrayBuffer>::Cast(CompileRun("ab"));
+ v8::Handle<TypedArray> ta1 =
+ v8::Handle<TypedArray>::Cast(CompileRun("ta1"));
+ v8::Handle<TypedArray> ta2 =
+ v8::Handle<TypedArray>::Cast(CompileRun("ta2"));
+ v8::Handle<TypedArray> ta3 =
+ v8::Handle<TypedArray>::Cast(CompileRun("ta3"));
CHECK_EQ(1, CountArrayBuffersInWeakList(isolate->heap()));
Handle<JSArrayBuffer> iab = v8::Utils::OpenHandle(*ab);
CHECK_EQ(3, CountTypedArrays(*iab));
@@ -306,14 +310,15 @@ static void TestTypedArrayFromScript(const char* constructor) {
{
v8::HandleScope s2(context->GetIsolate());
- v8::Handle<v8::ArrayBuffer> ab(v8::ArrayBuffer::Cast(*CompileRun("ab")));
+ v8::Handle<v8::ArrayBuffer> ab =
+ v8::Handle<v8::ArrayBuffer>::Cast(CompileRun("ab"));
Handle<JSArrayBuffer> iab = v8::Utils::OpenHandle(*ab);
CHECK_EQ(2, CountTypedArrays(*iab));
for (int j = 1; j <= 3; j++) {
if (j == i) continue;
i::OS::SNPrintF(source, "ta%d", j);
- v8::Handle<TypedArray> ta(
- TypedArray::Cast(*CompileRun(source.start())));
+ v8::Handle<TypedArray> ta =
+ v8::Handle<TypedArray>::Cast(CompileRun(source.start()));
CHECK(HasTypedArrayInWeakList(*iab, *v8::Utils::OpenHandle(*ta)));
}
}
@@ -326,7 +331,8 @@ static void TestTypedArrayFromScript(const char* constructor) {
{
v8::HandleScope s3(context->GetIsolate());
- v8::Handle<v8::ArrayBuffer> ab(v8::ArrayBuffer::Cast(*CompileRun("ab")));
+ v8::Handle<v8::ArrayBuffer> ab =
+ v8::Handle<v8::ArrayBuffer>::Cast(CompileRun("ab"));
Handle<JSArrayBuffer> iab = v8::Utils::OpenHandle(*ab);
CHECK_EQ(0, CountTypedArrays(*iab));
}
« no previous file with comments | « test/cctest/test-serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698