Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 463a15f6c3b4d650a433f77d988e72539a60aaae..0fa87e36709f80b0c009f0d27ed008a49cabe70e 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -369,7 +369,7 @@ MUST_USE_RESULT static MaybeObject* CallJsBuiltin( |
Handle<Object> js_builtin = |
GetProperty(Handle<JSObject>(isolate->native_context()->builtins()), |
- name); |
+ name).ToHandleChecked(); |
Handle<JSFunction> function = Handle<JSFunction>::cast(js_builtin); |
int argc = args.length() - 1; |
ScopedVector<Handle<Object> > argv(argc); |
@@ -514,18 +514,18 @@ BUILTIN(ArrayPop) { |
ElementsAccessor* accessor = array->GetElementsAccessor(); |
int new_length = len - 1; |
- Handle<Object> element; |
+ MaybeHandle<Object> maybe_element; |
if (accessor->HasElement(array, array, new_length, elms_obj)) { |
- element = accessor->Get( |
- array, array, new_length, elms_obj); |
+ maybe_element = accessor->Get(array, array, new_length, elms_obj); |
} else { |
Handle<Object> proto(array->GetPrototype(), isolate); |
- element = Object::GetElement(isolate, proto, len - 1); |
+ maybe_element = Object::GetElement(isolate, proto, len - 1); |
} |
- RETURN_IF_EMPTY_HANDLE(isolate, element); |
- RETURN_IF_EMPTY_HANDLE(isolate, |
- accessor->SetLength( |
- array, handle(Smi::FromInt(new_length), isolate))); |
+ Handle<Object> element; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, element, maybe_element); |
+ RETURN_IF_EMPTY_HANDLE( |
+ isolate, |
+ accessor->SetLength(array, handle(Smi::FromInt(new_length), isolate))); |
return *element; |
} |
@@ -550,8 +550,9 @@ BUILTIN(ArrayShift) { |
// Get first element |
ElementsAccessor* accessor = array->GetElementsAccessor(); |
- Handle<Object> first = accessor->Get(receiver, array, 0, elms_obj); |
- RETURN_IF_EMPTY_HANDLE(isolate, first); |
+ Handle<Object> first; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, first, accessor->Get(receiver, array, 0, elms_obj)); |
if (first->IsTheHole()) { |
first = isolate->factory()->undefined_value(); |
} |