Record more errors in BuildHIR::lowerStatement

Captures other kinds of statements that we're lowering to OtherStatements as 
TODO errors
This commit is contained in:
Lauren Tan
2023-01-18 10:58:50 -05:00
parent de83adc739
commit 23a044e406
3 changed files with 30 additions and 0 deletions
+6
View File
@@ -753,6 +753,12 @@ function lowerStatement(
case "TSNamespaceExportDeclaration":
case "TSTypeAliasDeclaration":
case "WithStatement": {
builder.pushError({
reason: `Unhandled statement type: ${stmtPath.type}`,
severity: ErrorSeverity.Todo,
source: stmtPath.toString(),
loc: null,
});
builder.push({
id: makeInstructionId(0),
lvalue: {
@@ -6,6 +6,11 @@ function foo([a, b], { c, d, e = "e" }, f = "f", ...args) {
let i = 0;
var x = [];
class Bar {}
with (true) {
}
for (; i < 3; i += 1) {
x.push(i);
}
@@ -27,6 +32,8 @@ function foo([a, b], {
}, f = "f", ...args) {
let i = 0;
var x = [];
class Bar {}
with (true) {}
for (; i < 3; i += 1) {
x.push(i);
}
@@ -42,6 +49,8 @@ function foo([a, b], {
}, f = "f", ...args) {
let i = 0;
var x = [];
class Bar {}
with (true) {}
for (; i < 3; i += 1) {
x.push(i);
}
@@ -57,6 +66,8 @@ function foo([a, b], {
}, f = "f", ...args) {
let i = 0;
var x = [];
class Bar {}
with (true) {}
for (; i < 3; i += 1) {
x.push(i);
}
@@ -72,6 +83,8 @@ function foo([a, b], {
}, f = "f", ...args) {
let i = 0;
var x = [];
class Bar {}
with (true) {}
for (; i < 3; i += 1) {
x.push(i);
}
@@ -82,6 +95,12 @@ function foo([a, b], {
Forget Error: [TODO] `var` declarations are not supported, use let or const on lines 3:3
var x = [];
Forget Error: [TODO] Unhandled statement type: ClassDeclaration
class Bar {}
Forget Error: [TODO] Unhandled statement type: WithStatement
with (true) {}
Forget Error: [TODO] Support non-variable initialization in for
for (; i < 3; i += 1) {
x.push(i);
@@ -2,6 +2,11 @@ function foo([a, b], { c, d, e = "e" }, f = "f", ...args) {
let i = 0;
var x = [];
class Bar {}
with (true) {
}
for (; i < 3; i += 1) {
x.push(i);
}