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

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

Issue 52021: Add a new C++ pointer wrapping API to External to not dilute the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 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/api.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
===================================================================
--- test/cctest/test-api.cc (revision 1577)
+++ test/cctest/test-api.cc (working copy)
@@ -1342,18 +1342,18 @@
// Make sure unaligned pointers are wrapped properly.
char* data = i::StrDup("0123456789");
- Local<v8::External> zero = v8::External::New(&data[0]);
- Local<v8::External> one = v8::External::New(&data[1]);
- Local<v8::External> two = v8::External::New(&data[2]);
- Local<v8::External> three = v8::External::New(&data[3]);
+ Local<v8::Value> zero = v8::External::Wrap(&data[0]);
+ Local<v8::Value> one = v8::External::Wrap(&data[1]);
+ Local<v8::Value> two = v8::External::Wrap(&data[2]);
+ Local<v8::Value> three = v8::External::Wrap(&data[3]);
- char* char_ptr = reinterpret_cast<char*>(zero->Value());
+ char* char_ptr = reinterpret_cast<char*>(v8::External::Unwrap(zero));
CHECK_EQ('0', *char_ptr);
- char_ptr = reinterpret_cast<char*>(one->Value());
+ char_ptr = reinterpret_cast<char*>(v8::External::Unwrap(one));
CHECK_EQ('1', *char_ptr);
- char_ptr = reinterpret_cast<char*>(two->Value());
+ char_ptr = reinterpret_cast<char*>(v8::External::Unwrap(two));
CHECK_EQ('2', *char_ptr);
- char_ptr = reinterpret_cast<char*>(three->Value());
+ char_ptr = reinterpret_cast<char*>(v8::External::Unwrap(three));
CHECK_EQ('3', *char_ptr);
i::DeleteArray(data);
}
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698