Skip to content

Commit 59c7190

Browse files
committed
Fix for compiler warning for unused return value in ndb nodejs code
v8::Object::DefineOwnProperty() is marked V8_WARN_UNUSED_RESULT. This results in a compiler warning that may escalated to an error. In js_wrapper_macros.h fix the macro SET_RO_PROPERTY() to call IsJust() on the v8::Maybe<bool> return value from DefineOwnProperty() so that it is technically "used", though we still ignore the actual bool result from the call.
1 parent dc16dce commit 59c7190

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jones-ndb/impl/include/common/js_wrapper_macros.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License, version 2.0,
@@ -91,8 +91,8 @@
9191
#if NODE_MAJOR_VERSION > 3
9292
#define SET_RO_PROPERTY(target, symbol, value) \
9393
(target)->DefineOwnProperty((target)->CreationContext(), \
94-
symbol, value, \
95-
static_cast<PropertyAttribute>(ReadOnly|DontDelete))
94+
symbol, value, static_cast<PropertyAttribute>\
95+
(ReadOnly|DontDelete)).IsJust()
9696
#else
9797
#define SET_RO_PROPERTY(target, symbol, value) \
9898
(target)->ForceSet(symbol, value, \

0 commit comments

Comments
 (0)