diff --git a/compiler/forget/src/HIR/BuildHIR.ts b/compiler/forget/src/HIR/BuildHIR.ts index dcc1b6dec0..2cd05e0edf 100644 --- a/compiler/forget/src/HIR/BuildHIR.ts +++ b/compiler/forget/src/HIR/BuildHIR.ts @@ -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: { diff --git a/compiler/forget/src/__tests__/fixtures/hir/error.todo-kitchensink.expect.md b/compiler/forget/src/__tests__/fixtures/hir/error.todo-kitchensink.expect.md index 59b87b225d..6f35790398 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/error.todo-kitchensink.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/error.todo-kitchensink.expect.md @@ -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); diff --git a/compiler/forget/src/__tests__/fixtures/hir/error.todo-kitchensink.js b/compiler/forget/src/__tests__/fixtures/hir/error.todo-kitchensink.js index 00726d7b46..06f6b2a64f 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/error.todo-kitchensink.js +++ b/compiler/forget/src/__tests__/fixtures/hir/error.todo-kitchensink.js @@ -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); }