Closed
Description
General pattern, specific example:
if (js_parse_var(s, true, tok, true))
goto fail;
Definition:
static __exception int js_parse_var(JSParseState *s, int parse_flags, int tok,
bool export_flag);
Ergo, the call site should look like this:
if (js_parse_var(s, PF_IN_ACCEPTED, tok, /*export_flag*/true))
goto fail;
It works okay because PF_IN_ACCEPTED == 1
and true == 1
but it's confusing.
In the particular case of js_parse_var, that export_flag
boolean could maybe be a PF_ flag instead. On the other hand, you could argue module exports aren't a parser concern and I wouldn't disagree.