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

Unified Diff: src/builtins.cc

Issue 231103002: Object::GetElements() and friends maybehandlification. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: FixedArray::UnionOfKeys() maybehandlified Created 6 years, 8 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 | « src/bootstrapper.cc ('k') | src/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « src/bootstrapper.cc ('k') | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698