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

Unified Diff: src/builtins.cc

Issue 1513713002: [cleanup] [proxies] Unify style of recently written code (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 5 years 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/key-accumulator.h » ('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 fcac684ce396c289438f15c97ca6789525611eea..74bcab553dc370bde58d006fc1128959e7f16f01 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1458,12 +1458,11 @@ BUILTIN(ReflectDefineProperty) {
return isolate->heap()->exception();
}
- bool result =
+ Maybe<bool> result =
JSReceiver::DefineOwnProperty(isolate, Handle<JSReceiver>::cast(target),
name, &desc, Object::DONT_THROW);
- if (isolate->has_pending_exception()) return isolate->heap()->exception();
- // TODO(neis): Make DefineOwnProperty return Maybe<bool>.
- return *isolate->factory()->ToBoolean(result);
+ MAYBE_RETURN(result, isolate->heap()->exception());
+ return *isolate->factory()->ToBoolean(result.FromJust());
}
@@ -1539,10 +1538,10 @@ BUILTIN(ReflectGetOwnPropertyDescriptor) {
Object::ToName(isolate, key));
PropertyDescriptor desc;
- bool found = JSReceiver::GetOwnPropertyDescriptor(
+ Maybe<bool> found = JSReceiver::GetOwnPropertyDescriptor(
isolate, Handle<JSReceiver>::cast(target), name, &desc);
- if (isolate->has_pending_exception()) return isolate->heap()->exception();
- if (!found) return isolate->heap()->undefined_value();
+ MAYBE_RETURN(found, isolate->heap()->exception());
+ if (!found.FromJust()) return isolate->heap()->undefined_value();
return *desc.ToObject(isolate);
}
« no previous file with comments | « src/bootstrapper.cc ('k') | src/key-accumulator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698