TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

JavaScript timers can be bypassed with “Infinity”

8 pointsby CryoLogicalmost 4 years ago

4 comments

dragonwriteralmost 4 years ago
Its not “bypassing” if you have to write the code used to setup the timer to do it.<p>I suppose it implies the existence of a class of potential problems if an application (1) accepts user input for timer delays, (2) requires a certain minimum delay, (3) only checks that the entered amount is &gt;= the minimum without considering overflow behavior. But, since this behavior is well-documented (the MDN page on setTimeout covers it), it doesn&#x27;t seem like any kind of notable discovery.
评论 #27988464 未加载
himinlomaxalmost 4 years ago
Am I missing something or is this as dumb as it looks? How&#x27;s that different from using 0?
评论 #27991074 未加载
whoomp12342almost 4 years ago
this is no different than passing 0 right? I fail to see the significance, other than the fact that infinity doesn&#x27;t work the way you think it would.
zodiakzzalmost 4 years ago
&quot;Hack&quot;? Cute. Is this guy&#x27;s first day at programming?