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

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: 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') | test/mjsunit/regress/regress-1105.js » ('J')
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..2ee9a2b0aa8ef67b660c49c7c047916979f0c9c4 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1089,7 +1089,8 @@ 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()) return Failure::Exception();
antonm 2011/02/08 13:33:01 I know we do not typically do it, so feel free to
Lasse Reichstein 2011/02/08 13:38:57 And yet, if we had done it here, we would have cau
} else {
// If a property with this name does not already exist on the
// global object add the property locally. We take special
@@ -1097,7 +1098,9 @@ 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()) return Failure::Exception();
}
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1105.js » ('j') | test/mjsunit/regress/regress-1105.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698