We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f833213 commit d2377a4Copy full SHA for d2377a4
lib/Parser/Scan.cpp
@@ -1783,6 +1783,11 @@ tokens Scanner<EncodingPolicy>::ScanCore(bool identifyKwds)
1783
}
1784
else if (m_scriptContext->GetConfig()->IsESOptionalChainingEnabled() && this->PeekFirst(p, last) == '.')
1785
{
1786
+ // `a?.3:0` is actually a ternary operator containing the number `0.3`
1787
+ bool isTernary = CharTypes::_C_DIG == this->charClassifier->GetCharType(this->PeekFirst(p + 1, last));
1788
+ if (isTernary)
1789
+ break;
1790
+
1791
p++;
1792
token = tkOptChain;
1793
break;
0 commit comments