Skip to content

Commit

Permalink
fix E0459 docs errors and formatting in test-parse-typescript.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderMuffin committed Apr 28, 2024
1 parent 079f917 commit be0a0f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/errors/E0459.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ x == y;

To resolve this, either correct to `=` instead:
```javascript
let x = 4;
let y = 5;

x = y; // no error
```

Or use/discard the result:
```javascript
let x = 4;
let y = 5;
function f(_) { }

let _ = x == y;
void (x == y);
f(x == y);
Expand Down
7 changes: 4 additions & 3 deletions test/test-parse-typescript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ TEST_F(Test_Parse_TypeScript, warn_on_mistyped_strict_inequality_operator) {
TEST_F(Test_Parse_TypeScript,
mistyped_strict_inequality_operator_is_suppressable) {
test_parse_and_visit_expression(u8"(x!) == y"_sv, no_diags,
typescript_options);
typescript_options);
test_parse_and_visit_expression(u8"x! /**/ == y"_sv, no_diags,
typescript_options);
test_parse_and_visit_expression(u8"x!\n== y"_sv, no_diags, typescript_options);
typescript_options);
test_parse_and_visit_expression(u8"x!\n== y"_sv, no_diags,
typescript_options);
}

TEST_F(Test_Parse_TypeScript, unicode_next_line_is_whitespace) {
Expand Down

0 comments on commit be0a0f1

Please sign in to comment.