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

Unified Diff: src/handles.cc

Issue 231883007: Return MaybeHandle from Invoke. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/handles.h ('k') | src/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index 0c6cbd37b4ef08795b1292ed8a2d7986c2394f49..e9f28987b7443c1aa71926f5511f7ce3510613a2 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -406,12 +406,11 @@ Handle<Object> GetScriptNameOrSourceURL(Handle<Script> script) {
Object::GetProperty(script_wrapper, name_or_source_url_key);
ASSERT(property->IsJSFunction());
Handle<JSFunction> method = Handle<JSFunction>::cast(property);
- bool caught_exception;
- Handle<Object> result = Execution::TryCall(method, script_wrapper, 0,
- NULL, &caught_exception);
- if (caught_exception) {
- result = isolate->factory()->undefined_value();
- }
+ Handle<Object> result;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, result,
+ Execution::TryCall(method, script_wrapper, 0, NULL),
+ isolate->factory()->undefined_value());
return result;
}
@@ -445,17 +444,19 @@ MaybeHandle<FixedArray> GetKeysInFixedArrayFor(Handle<JSReceiver> object,
if (p->IsJSProxy()) {
Handle<JSProxy> proxy(JSProxy::cast(*p), isolate);
Handle<Object> args[] = { proxy };
- bool has_pending_exception;
- Handle<Object> names = Execution::Call(isolate,
- isolate->proxy_enumerate(),
- object,
- ARRAY_SIZE(args),
- args,
- &has_pending_exception);
- if (has_pending_exception) return MaybeHandle<FixedArray>();
+ Handle<Object> names;
+ ASSIGN_RETURN_ON_EXCEPTION(
+ isolate, names,
+ Execution::Call(isolate,
+ isolate->proxy_enumerate(),
+ object,
+ ARRAY_SIZE(args),
+ args),
+ FixedArray);
ASSIGN_RETURN_ON_EXCEPTION(
isolate, content,
- FixedArray::AddKeysFromJSArray(content, Handle<JSArray>::cast(names)),
+ FixedArray::AddKeysFromJSArray(
+ content, Handle<JSArray>::cast(names)),
FixedArray);
break;
}
@@ -536,25 +537,12 @@ MaybeHandle<FixedArray> GetKeysInFixedArrayFor(Handle<JSReceiver> object,
// If we only want local properties we bail out after the first
// iteration.
- if (type == LOCAL_ONLY)
- break;
+ if (type == LOCAL_ONLY) break;
}
return content;
}
-MaybeHandle<JSArray> GetKeysFor(Handle<JSReceiver> object) {
- Isolate* isolate = object->GetIsolate();
- isolate->counters()->for_in()->Increment();
- Handle<FixedArray> elements;
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate, elements,
- GetKeysInFixedArrayFor(object, INCLUDE_PROTOS),
- JSArray);
- return isolate->factory()->NewJSArrayWithElements(elements);
-}
-
-
Handle<FixedArray> ReduceFixedArrayTo(Handle<FixedArray> array, int length) {
ASSERT(array->length() >= length);
if (array->length() == length) return array;
« no previous file with comments | « src/handles.h ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698