Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js: add a special case for safe navigation #1594

Merged
merged 1 commit into from
Oct 13, 2020
Merged

Conversation

jneen
Copy link
Member

@jneen jneen commented Sep 25, 2020

Fixes #1591

Previously, the example ${obj?.prop} would result in a runaway string
literal, since the ? would start a ternary expression, and we would lose
the stack state that would cause the second ` to terminate the literal.
It is possible the handling of ? needs more care in modern javascript.

Fixes #1591

Previously, the example `${obj?.prop}` would result in a runaway string
literal, since the ? would start a ternary expression, and we would lose
the stack state that would cause the second ` to terminate the literal.
It is possible the handling of ? needs more care in modern javascript.
@pyrmont pyrmont self-assigned this Oct 13, 2020
@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Oct 13, 2020
@pyrmont pyrmont merged commit 5337d8d into master Oct 13, 2020
mattt pushed a commit to NSHipster/rouge that referenced this pull request May 19, 2021
Previously, the example `${obj?.prop}` would result in a runaway string
literal, since the `?` would start a ternary expression, and Rouge
would lose the stack state causing the second `` ` `` to terminate the
literal. This commit fixes that issue.
@tancnle tancnle deleted the bugfix.js-safe-navigation branch September 22, 2021 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review The PR needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JS: non string-literal highlighted as string literal
2 participants