Commit c8241635 authored by haraken's avatar haraken Committed by Commit bot

Change an output parameter of Maybe<T>::To() from a reference to a pointer

This is a follow-up fix for https://codereview.chromium.org/2194793003/

BUG=

Review-Url: https://codereview.chromium.org/2205203002
Cr-Commit-Position: refs/heads/master@{#38305}
parent aacbdacb
......@@ -6916,8 +6916,8 @@ class Maybe {
// Will crash if the Maybe<> is nothing.
V8_INLINE T ToChecked() const { return FromJust(); }
V8_WARN_UNUSED_RESULT V8_INLINE bool To(T& out) const {
if (V8_LIKELY(IsJust())) out = value_;
V8_WARN_UNUSED_RESULT V8_INLINE bool To(T* out) const {
if (V8_LIKELY(IsJust())) *out = value_;
return IsJust();
}
......
......@@ -335,7 +335,7 @@ THREADED_TEST(Access) {
CHECK(obj->Set(env.local(), v8_str("foo"), bar_str).ToChecked());
bool result;
CHECK(obj->Set(env.local(), v8_str("foo"), bar_str).To(result));
CHECK(obj->Set(env.local(), v8_str("foo"), bar_str).To(&result));
CHECK(result);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment