-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
Macro brainstorming for Maybe<>/MaybeLocal<> #1872
Copy link
Copy link
Closed
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Metadata
Metadata
Assignees
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Dealing with
Maybe<>s andMaybeLocal<>s in V8 4.3 are a pain, as I found out in #1773 and @trevnorris found out in #1825. This could maybe be made better with macros.Here is one proposal:
This would introduce a local variable
fooof typeLocal<Object>(and another onemaybe_fooof typeMaybeLocal<Object>) in the exact same way as the above code. Either the function will have returned, orfoowill contain a non-emptyLocal<Object>. I am 95% sure this is easy to write a macro for.Ideas/issues:
Objectpart for us. Can it, perhaps using auto or decltype or something?Local<Object> foo = UN_MAYBE(get_foo_from_v8()). Does anyone have good enough macro skills for that?void, we'd need a return type too.has_pending_exceptionthroughout the code). Is there a good reason for that? Should we do something more like that?