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

Unified Diff: src/isolate.h

Issue 1397853005: [es6] Partially implement Reflect.preventExtensions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: s/Object/JSObject/ Created 5 years, 2 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
Index: src/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index 8f4915cefd55bbab5f0f19b70a41ad7a08a8e734..fdf2c61c24f652373ed49aace35f1155639a3132 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -164,6 +164,31 @@ typedef ZoneList<Handle<Object> > ZoneObjectList;
RETURN_ON_EXCEPTION_VALUE(isolate, call, MaybeHandle<T>())
+// Macros for Maybe.
+
+#define ASSIGN_OR_RETURN_EXCEPTION(isolate, T, dst, call) \
+ T dst; \
rossberg 2015/10/19 14:33:08 I'm afraid you can't do that, this breaks the macr
neis 2015/10/20 07:58:35 Done.
+ do { \
+ Maybe<T> result_of_the_call = (call); \
+ if (result_of_the_call.IsNothing()) { \
+ DCHECK((isolate)->has_pending_exception()); \
+ return isolate->heap()->exception(); \
+ } \
+ dst = result_of_the_call.FromJust(); \
+ } while (false)
+
+
+#define ASSIGN_OR_RETURN(T, dst, call, value) \
+ T dst; \
+ do { \
+ Maybe<T> result_of_the_call = (call); \
+ if (result_of_the_call.IsNothing()) { \
+ return value; \
+ } \
+ dst = result_of_the_call.FromJust(); \
+ } while (false)
+
+
#define FOR_EACH_ISOLATE_ADDRESS_NAME(C) \
C(Handler, handler) \
C(CEntryFP, c_entry_fp) \

Powered by Google App Engine
This is Rietveld 408576698