Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/checker/javascript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ pub fn check_string_literal(lit: &StringLiteral, ctx: &SemanticBuilder<'_>) {
if c == '\\' {
match chars.next() {
Some('0') => {
if chars.peek().is_some_and(|c| ('1'..='9').contains(c)) {
if chars.peek().is_some_and(char::is_ascii_digit) {
return ctx.error(legacy_octal(lit.span));
}
}
Expand Down
1 change: 1 addition & 0 deletions tasks/coverage/misc/fail/escape-00.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const escape00 = "\00";
9 changes: 8 additions & 1 deletion tasks/coverage/snapshots/parser_misc.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parser_misc Summary:
AST Parsed : 49/49 (100.00%)
Positive Passed: 49/49 (100.00%)
Negative Passed: 112/112 (100.00%)
Negative Passed: 113/113 (100.00%)

× Cannot assign to 'arguments' in strict mode
╭─[misc/fail/arguments-eval.ts:1:10]
Expand Down Expand Up @@ -72,6 +72,13 @@ Negative Passed: 112/112 (100.00%)
If you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased.
If you have nested conflicts, resolve the outermost conflict first.

× '0'-prefixed octal literals and octal escape sequences are deprecated
╭─[misc/fail/escape-00.js:1:25]
1 │ export const escape00 = "\00";
· ─────
╰────
help: for octal literals use the '0o' prefix instead

× Expected `,` or `]` but found `const`
╭─[misc/fail/imbalanced-array-expr.js:2:1]
1 │ const foo = [0, 1
Expand Down
Loading