Reviewers: Mads Ager,

Message:
Mads,

may you have a look?

If LGTMed, I'll bring this fix to previous branches as well.

Description:
Properly propagate failures from helper methods.

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

Please review this at http://codereview.chromium.org/3035017/show

Affected files:
  M src/objects.cc


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 8f668fb3b142570207cc07080e5c9b1f71966d51..7a08eec3fb5e341b070751c24e7c26eb2f9a04f8 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2966,7 +2966,8 @@ Object* JSObject::DefineAccessor(AccessorInfo* info) {
         break;
     }

-    SetElementCallback(index, info, info->property_attributes());
+ Object* ok = SetElementCallback(index, info, info->property_attributes());
+    if (ok->IsFailure()) return ok;
   } else {
     // Lookup the name.
     LookupResult result;
@@ -2976,7 +2977,8 @@ Object* JSObject::DefineAccessor(AccessorInfo* info) {
if (result.IsProperty() && (result.IsReadOnly() || result.IsDontDelete())) {
       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;


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to