Chromium Code Reviews| Index: src/accessors.cc |
| diff --git a/src/accessors.cc b/src/accessors.cc |
| index 9bd6e5bb2c1b9bba335606f1ce6e3c1f47c04e92..f99056f35eb3a9c959ab446a02856faf16a5d30f 100644 |
| --- a/src/accessors.cc |
| +++ b/src/accessors.cc |
| @@ -172,7 +172,10 @@ void Accessors::ArgumentsIteratorSetter( |
| LookupIterator it(object, Utils::OpenHandle(*name)); |
| CHECK_EQ(LookupIterator::ACCESSOR, it.state()); |
| DCHECK(it.HolderIsReceiverOrHiddenPrototype()); |
| - Object::SetDataProperty(&it, value); |
| + |
| + if (Object::SetDataProperty(&it, value).is_null()) { |
| + isolate->OptionalRescheduleException(false); |
| + } |
| } |
| @@ -247,7 +250,7 @@ void Accessors::ArrayLengthSetter( |
| if (uint32_v->Number() == number_v->Number()) { |
| maybe = JSArray::SetElementsLength(array_handle, uint32_v); |
| - maybe.Check(); |
| + if (maybe.is_null()) isolate->OptionalRescheduleException(false); |
| return; |
| } |
| @@ -881,9 +884,9 @@ static Handle<Object> GetFunctionPrototype(Isolate* isolate, |
| } |
| -static Handle<Object> SetFunctionPrototype(Isolate* isolate, |
| - Handle<JSFunction> function, |
| - Handle<Object> value) { |
| +static MaybeHandle<Object> SetFunctionPrototype(Isolate* isolate, |
|
Igor Sheludko
2014/10/13 10:47:24
MUST_USE_RESULT?
|
| + Handle<JSFunction> function, |
| + Handle<Object> value) { |
| Handle<Object> old_value; |
| bool is_observed = function->map()->is_observed(); |
| if (is_observed) { |
| @@ -897,16 +900,20 @@ static Handle<Object> SetFunctionPrototype(Isolate* isolate, |
| DCHECK(function->prototype() == *value); |
| if (is_observed && !old_value->SameValue(*value)) { |
| - JSObject::EnqueueChangeRecord( |
| + MaybeHandle<Object> result = JSObject::EnqueueChangeRecord( |
| function, "update", isolate->factory()->prototype_string(), old_value); |
| + if (result.is_null()) { |
| + isolate->OptionalRescheduleException(false); |
| + return MaybeHandle<Object>(); |
| + } |
| } |
| return function; |
| } |
| -Handle<Object> Accessors::FunctionSetPrototype(Handle<JSFunction> function, |
| - Handle<Object> prototype) { |
| +MaybeHandle<Object> Accessors::FunctionSetPrototype(Handle<JSFunction> function, |
| + Handle<Object> prototype) { |
| DCHECK(function->should_have_prototype()); |
| Isolate* isolate = function->GetIsolate(); |
| return SetFunctionPrototype(isolate, function, prototype); |