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

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

Issue 11194050: Added a workaroung for a GCC visibility bug. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 | « no previous file | 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 78151881655a8e270f8f7226aaf51562f1d11ce6..16a393838aaabc4affbbc6c42f97268ad89592bf 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -16179,6 +16179,28 @@ TEST(DontDeleteCellLoadICAPI) {
}
+class Visitor42 : public v8::PersistentHandleVisitor {
+ public:
+ explicit Visitor42(v8::Persistent<v8::Object> object)
+ : counter_(0), object_(object) { }
+
+ virtual void VisitPersistentHandle(Persistent<Value> value,
+ uint16_t class_id) {
+ if (class_id == 42) {
+ CHECK(value->IsObject());
+ v8::Persistent<v8::Object> visited =
+ v8::Persistent<v8::Object>::Cast(value);
+ CHECK_EQ(42, visited.WrapperClassId());
+ CHECK_EQ(object_, visited);
+ ++counter_;
+ }
+ }
+
+ int counter_;
+ v8::Persistent<v8::Object> object_;
+};
+
+
TEST(PersistentHandleVisitor) {
v8::HandleScope scope;
LocalContext context;
@@ -16188,27 +16210,7 @@ TEST(PersistentHandleVisitor) {
object.SetWrapperClassId(42);
CHECK_EQ(42, object.WrapperClassId());
- class Visitor : public v8::PersistentHandleVisitor {
- public:
- explicit Visitor(v8::Persistent<v8::Object> object)
- : counter_(0), object_(object) { }
-
- virtual void VisitPersistentHandle(Persistent<Value> value,
- uint16_t class_id) {
- if (class_id == 42) {
- CHECK(value->IsObject());
- v8::Persistent<v8::Object> visited =
- v8::Persistent<v8::Object>::Cast(value);
- CHECK_EQ(42, visited.WrapperClassId());
- CHECK_EQ(object_, visited);
- ++counter_;
- }
- }
-
- int counter_;
- v8::Persistent<v8::Object> object_;
- } visitor(object);
-
+ Visitor42 visitor(object);
v8::V8::VisitHandlesWithClassIds(&visitor);
CHECK_EQ(1, visitor.counter_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698