https://codereview.chromium.org/959223002/diff/1/include/v8.h
File include/v8.h (right):
https://codereview.chromium.org/959223002/diff/1/include/v8.h#newcode984
include/v8.h:984: explicit Maybe(T t) : has_value(true), value(t) {}
While we're here: Make this a "const T& t", the current signature is
embarrassing.
https://codereview.chromium.org/959223002/diff/1/include/v8.h#newcode988
include/v8.h:988: bool HasValue() { return value; }
This should return has_value, I guess...
https://codereview.chromium.org/959223002/diff/1/include/v8.h#newcode991
include/v8.h:991: if (has_value) {
Test is wrong, safer and more obvious way:
*out = has_value ? value : T();
return has_value;
https://codereview.chromium.org/959223002/diff/1/src/api.cc
File src/api.cc (right):
https://codereview.chromium.org/959223002/diff/1/src/api.cc#newcode2646
src/api.cc:2646: #define RETURN_MAYBE_DEFAULT(maybe_value,
default_value, T) \
I think this should actually be a member function of Maybe, see
https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Maybe.html#v:maybe.
But we can do this separately later.
https://codereview.chromium.org/959223002/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.