Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
sunrabbit123 committed Sep 9, 2023
1 parent 015096f commit c301686
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 24 deletions.
21 changes: 10 additions & 11 deletions crates/stc_ts_file_analyzer/src/analyzer/expr/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1217,18 +1217,17 @@ impl Analyzer<'_, '_> {
self.cur_facts.true_facts.facts.insert(name.clone(), TypeFacts::NEUndefined);
}
}
} else if r_ty.is_undefined() && !is_eq {
if is_strict {
for name in names {
self.cur_facts.true_facts.facts.insert(name.clone(), TypeFacts::NEUndefined);
}
} else {
for name in names {
self.cur_facts.true_facts.facts.insert(name.clone(), TypeFacts::NEUndefinedOrNull);
}
}
}
// else if !is_eq {
// if is_strict {
// for name in names {
// self.cur_facts.true_facts.facts.insert(name.clone(),
// TypeFacts::NEUndefined); }
// } else {
// for name in names {
// self.cur_facts.true_facts.facts.insert(name.clone(),
// TypeFacts::NEUndefinedOrNull); }
// }
// }
}

// TODO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required_errors": {
"TS2454": 4,
"TS2722": 2,
"TS2532": 16
"TS2532": 18
},
"required_error_lines": {
"TS2454": [
Expand All @@ -25,6 +25,8 @@
223,
241,
244,
370,
382,
421,
424,
433,
Expand All @@ -36,7 +38,7 @@
},
"extra_errors": {
"TS2339": 3,
"TS2532": 12,
"TS2532": 7,
"TS2531": 6,
"TS7027": 2
},
Expand All @@ -48,12 +50,7 @@
],
"TS2532": [
184,
253,
256,
259,
268,
289,
367,
394,
476,
480,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 22,
matched_error: 39,
extra_error: 23,
required_error: 24,
matched_error: 37,
extra_error: 18,
panic: 0,
}
6 changes: 3 additions & 3 deletions crates/stc_ts_type_checker/tests/tsc-stats.rust-debug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 3493,
matched_error: 6542,
extra_error: 762,
required_error: 3495,
matched_error: 6540,
extra_error: 757,
panic: 73,
}

0 comments on commit c301686

Please sign in to comment.