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

Unified Diff: src/runtime.cc

Issue 6451003: Correct propagation of exceptions from setters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build-ia32
Patch Set: Addressed review comments 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-1105.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 8ad65ddfef8da1b668f8e0f99ac6c78f00ad59b6..88e9b6a00d55a7a25cc67b4b1e8c194c338051b4 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1089,7 +1089,11 @@ static MaybeObject* Runtime_DeclareGlobals(Arguments args) {
const char* type = (lookup.IsReadOnly()) ? "const" : "var";
return ThrowRedeclarationError(type, name);
}
- SetProperty(global, name, value, attributes);
+ Handle<Object> result = SetProperty(global, name, value, attributes);
+ if (result.is_null()) {
+ ASSERT(Top::has_pending_exception());
+ return Failure::Exception();
+ }
} else {
// If a property with this name does not already exist on the
// global object add the property locally. We take special
@@ -1097,10 +1101,16 @@ static MaybeObject* Runtime_DeclareGlobals(Arguments args) {
// of callbacks in the prototype chain (this rules out using
// SetProperty). Also, we must use the handle-based version to
// avoid GC issues.
- SetLocalPropertyIgnoreAttributes(global, name, value, attributes);
+ Handle<Object> result =
+ SetLocalPropertyIgnoreAttributes(global, name, value, attributes);
+ if (result.is_null()) {
+ ASSERT(Top::has_pending_exception());
+ return Failure::Exception();
+ }
}
}
+ ASSERT(!Top::has_pending_exception());
return Heap::undefined_value();
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1105.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698