Commit b8b12b27 authored by antonm@chromium.org's avatar antonm@chromium.org

Properly propagate failures from helper methods.

Otherwise failures are not reported and callback may fail to setup.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5120 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 63503a3f
...@@ -2966,7 +2966,8 @@ Object* JSObject::DefineAccessor(AccessorInfo* info) { ...@@ -2966,7 +2966,8 @@ Object* JSObject::DefineAccessor(AccessorInfo* info) {
break; break;
} }
SetElementCallback(index, info, info->property_attributes()); Object* ok = SetElementCallback(index, info, info->property_attributes());
if (ok->IsFailure()) return ok;
} else { } else {
// Lookup the name. // Lookup the name.
LookupResult result; LookupResult result;
...@@ -2976,7 +2977,8 @@ Object* JSObject::DefineAccessor(AccessorInfo* info) { ...@@ -2976,7 +2977,8 @@ Object* JSObject::DefineAccessor(AccessorInfo* info) {
if (result.IsProperty() && (result.IsReadOnly() || result.IsDontDelete())) { if (result.IsProperty() && (result.IsReadOnly() || result.IsDontDelete())) {
return Heap::undefined_value(); return Heap::undefined_value();
} }
SetPropertyCallback(name, info, info->property_attributes()); Object* ok = SetPropertyCallback(name, info, info->property_attributes());
if (ok->IsFailure()) return ok;
} }
return this; return this;
......
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