LibJS: Add missing undefined fallback to IfStatement completions

Also add spec comments.
This commit is contained in:
Linus Groh 2021-12-31 15:38:38 +01:00
commit d7f6635d55
Notes: sideshowbarker 2024-07-17 21:52:51 +09:00
2 changed files with 23 additions and 4 deletions

View file

@ -0,0 +1,4 @@
test("if statement consequent/alternate expression returns empty completion", () => {
expect(eval("1; if (true) {}")).toBeUndefined();
expect(eval("1; if (false) {} else {}")).toBeUndefined();
});