Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
jsc's settimeout should properly handle a delay
https://bugs.webkit.org/show_bug.cgi?id=240467 Reviewed by Yusuke Suzuki. This patch makes it so that we properly handle a timeout passed to the JSC CLI setTimeout API. Previously we would just run the callback on the next runloop tick regardless of the passed value. * Source/JavaScriptCore/jsc.cpp: (JSC_DEFINE_HOST_FUNCTION): Canonical link: https://commits.webkit.org/251434@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
2 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
let startTime = Date.now(); | ||
let waitTime = 1000; | ||
|
||
setTimeout(() => { | ||
if (startTime + waitTime > Date.now()) | ||
throw new Error(); | ||
}, waitTime); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters