Commit 144cca7d authored by asargent@chromium.org's avatar asargent@chromium.org

Fix v8::Object::DeleteHiddenValue to not bail when there are no hidden properties.


Review URL: http://codereview.chromium.org/58016


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1687 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 34064c82
......@@ -2077,13 +2077,13 @@ bool v8::Object::DeleteHiddenValue(v8::Handle<v8::String> key) {
ON_BAILOUT("v8::DeleteHiddenValue()", return false);
ENTER_V8;
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
i::Handle<i::JSObject> hidden_props(
i::JSObject::cast(*i::GetHiddenProperties(self, false)));
i::Handle<i::Object> hidden_props(i::GetHiddenProperties(self, false));
if (hidden_props->IsUndefined()) {
return false;
return true;
}
i::Handle<i::JSObject> js_obj(i::JSObject::cast(*hidden_props));
i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
return i::DeleteProperty(hidden_props, key_obj)->IsTrue();
return i::DeleteProperty(js_obj, key_obj)->IsTrue();
}
......
......@@ -1293,6 +1293,9 @@ THREADED_TEST(HiddenProperties) {
i::Heap::CollectAllGarbage();
// Make sure delete of a non-existent hidden value works
CHECK(obj->DeleteHiddenValue(key));
CHECK(obj->SetHiddenValue(key, v8::Integer::New(1503)));
CHECK_EQ(1503, obj->GetHiddenValue(key)->Int32Value());
CHECK(obj->SetHiddenValue(key, v8::Integer::New(2002)));
......
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