Chromium Code Reviews| 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(); |
| } |
| } |