The following file should have an error in any JS file that isn't explicitly opted out of JS checking:
function f() {
await new Promise(undefined);
}
Expected: "await expressions are only allowed within async functions"
Actual: no error.
Note that other plain JS errors work fine; function f() { break } and const x = 1; const x = 2 both error as expected.
The following file should have an error in any JS file that isn't explicitly opted out of JS checking:
Expected: "await expressions are only allowed within async functions"
Actual: no error.
Note that other plain JS errors work fine;
function f() { break }andconst x = 1; const x = 2both error as expected.