#How to prevent lexical error in build?
1 messages · Page 1 of 1 (latest)
function callAsync(cb: () => void) {
setTimeout(cb, 0);
return 0;
}
function callSync(cb: () => void) {
cb();
return 0;
}
const x = callAsync(() => console.log(x)); // okay
const y = callSync(() => console.log(y)) // runtime error
There's no way to know just by looking at the call site to know if this is safe or not.