Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
Why doesn't microtask have timeout?
async function() {
  while (true) {
    await null;
  }
}

This will block the thread forever, because the event loop would try to finish all microtasks in one frame.

But if the event loop suspends processing next microtask after 1 second, the thread can be used to process other code, for example, animation frame.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Could it be possible for a JavaScript engine to detect potentially bad code?

Yes!

Is this useful?

Certainly could be. After all, TypeScript's and (to some extent) ESLint's job is to find problematic code and warn you.

Does the engine warn against potentially code?

Sometimes! For instance, most engines will warn you when rejected Promises remain uncaught.

Why don't they for this case?

I can't speak for JavaScript engine manufacturers, but I can potentially imagine that if they would implement a warning / some behavior against your pet issue is going to be based on a number of factors, including how likely it is that this is a problem, how easy it is to detect and what's the cost in the engine to try and figure out if something bad is happening. Nothing is free and JavaScript engines need to be fast.

In my opinion this is an unlikely mistake for someone to make, and if the mistake is made it's quickly noticed because of how bad the effects are. This doesn't feel like the case where handholding is needed.

But even if this is a common problem, I feel ESLint is probably still a better place for something to detect and warn you.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!