V8_CONSTANT_FALLBACK() is commonly used to indicate that a value is optional and that it has a fallback value by setting V8_CONSTANT_OPTIONAL, among other things. However, v8o_optional is set to non-zero and V8_CONSTANT_FALLBACK() is used, the fallback value will never be used. This is confusing.
Worse, there are some offsets that are improperly initialized such that v8o_optional is set to a non-zero value intended for v8o_flags. A proper v8_offset_t initializer is:
It is understandable that someone made this mistake. v8_constants[] uses very similar initializers but does not have an equivalent of the v8o_optional field.
Code inspection and testing suggests that v8o_optional should go away.
mdb_v8.c has:
v8o_flags
has:V8_CONSTANT_FALLBACK()
is commonly used to indicate that a value is optional and that it has a fallback value by settingV8_CONSTANT_OPTIONAL
, among other things. However,v8o_optional
is set to non-zero andV8_CONSTANT_FALLBACK()
is used, the fallback value will never be used. This is confusing.Worse, there are some offsets that are improperly initialized such that
v8o_optional
is set to a non-zero value intended forv8o_flags
. A properv8_offset_t
initializer is:Examples of improper initializers that omit the (required)
v8o_optional
field are:It is understandable that someone made this mistake.
v8_constants[]
uses very similar initializers but does not have an equivalent of thev8o_optional
field.Code inspection and testing suggests that
v8o_optional
should go away.