-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Labels
Description
It would be great if njs could support optional chaining.
Looking at the codebase, I actually found this function pertaining to optional chaining:
Line 2962 in 855aa4c
| njs_parser_optional_chain(njs_parser_t *parser, njs_lexer_token_t *token, |
But, unless I'm doing something silly, it doesn't seem to work as I expected.
For example, a simple call like the following produces an error:
>> Object.xxx?.();
Thrown:
SyntaxError: Unexpected token "(" in shell:1Whereas the same code in, say, Node.js, Firefox or Chrome will succeed:
undefined
So am I missing something obvious?