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

Unified Diff: src/runtime.cc

Issue 6454011: 1) Return failure if any of property sets failed; (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cleaning up Created 9 years, 10 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 | test/mjsunit/regress/regress-1119.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 3e38d388d8c9607a6cb9f4b066129c5ea2f247fb..1993f4dda7a96d6dd23cae35c88cc9bfae3bd20c 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1143,12 +1143,15 @@ static MaybeObject* Runtime_DeclareContextSlot(Arguments args) {
} else {
// The holder is an arguments object.
Handle<JSObject> arguments(Handle<JSObject>::cast(holder));
- SetElement(arguments, index, initial_value);
+ Handle<Object> result = SetElement(arguments, index, initial_value);
+ if (result.is_null()) return Failure::Exception();
}
} else {
// Slow case: The property is not in the FixedArray part of the context.
Handle<JSObject> context_ext = Handle<JSObject>::cast(holder);
- SetProperty(context_ext, name, initial_value, mode);
+ Handle<Object> result =
+ SetProperty(context_ext, name, initial_value, mode);
+ if (result.is_null()) return Failure::Exception();
}
}
@@ -1175,8 +1178,8 @@ static MaybeObject* Runtime_DeclareContextSlot(Arguments args) {
ASSERT(!context_ext->HasLocalProperty(*name));
Handle<Object> value(Heap::undefined_value());
if (*initial_value != NULL) value = initial_value;
- SetProperty(context_ext, name, value, mode);
- ASSERT(context_ext->GetLocalPropertyAttribute(*name) == mode);
+ Handle<Object> result = SetProperty(context_ext, name, value, mode);
+ if (result.is_null()) return Failure::Exception();
}
return Heap::undefined_value();
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1119.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698