Commit 913b244b authored by dcarney@chromium.org's avatar dcarney@chromium.org

invert Eternal::IsEmpty logic

R=svenpanne@chromium.org
BUG=v8:2870

Review URL: https://codereview.chromium.org/23914004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16517 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6f8713e2
......@@ -458,7 +458,7 @@ template <class T> class Eternal {
}
// Can only be safely called if already set.
V8_INLINE(Local<T> Get(Isolate* isolate));
V8_INLINE(bool IsEmpty()) { return index_ != kInitialValue; }
V8_INLINE(bool IsEmpty()) { return index_ == kInitialValue; }
template<class S>
V8_INLINE(void Set(Isolate* isolate, Local<S> handle));
......
......@@ -338,9 +338,9 @@ TEST(EternalHandles) {
eternal_handles->Create(
isolate, *v8::Utils::OpenHandle(*object), &indices[i]);
// Create with external api
CHECK(!eternals[i].IsEmpty());
eternals[i].Set(v8_isolate, object);
CHECK(eternals[i].IsEmpty());
eternals[i].Set(v8_isolate, object);
CHECK(!eternals[i].IsEmpty());
}
isolate->heap()->CollectAllAvailableGarbage();
......@@ -370,7 +370,7 @@ TEST(EternalHandles) {
HandleScope scope(isolate);
v8::Local<v8::Object> object = v8::Object::New();
v8::Eternal<v8::Object> eternal(v8_isolate, object);
CHECK(eternal.IsEmpty());
CHECK(!eternal.IsEmpty());
CHECK(object == eternal.Get(v8_isolate));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment