-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
It appears that the only way to get a nullish coalescing operator (??) is to enable the --nullish option, but this is a global option, so every use of a logical or
or ||
turns into a ??
. This means that normal logical tests are broken.
if (a == 1) || (a == 2) && (b== 3)
...stuff
end
results in
if ((a === 1) ?? (a === 2) && (b === 3)) {
...stuff
}
which will throw a syntax error as it's nonsense.
The problem is that there doesn't seem to be a way of using nullish coalescing without this option.
Metadata
Metadata
Assignees
Labels
No labels