-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent timeout value from skirting limit check (#3536)
* fix(lib/runnable.js): Prevent timeout value from skirting limit check - Moved the timestring->value translation code to before the limit check. - Found that previous "fix" hadn't actually fixed the correct value, as the wrong upper bound value had been used (off by one error). - Further research indicated that some versions of IE had problems with negative timeout values. New code clamps to nonnegative numbers ending at `INT_MAX`. - Updated the function documentation. * feat(lib/utils.js): Add `clamp` function - New function clamps a numeric value to a given range. * test(unit/runnable.spec.js): Updated tests for `#timeout(ms)` - Restructured `Runnable#timeout` tests to check both numeric/timestamp input values that: - less than lower limit - equal to lower limit - within limits - equal to upper limit - greater than upper limit Closes #1652
- Loading branch information
Showing
3 changed files
with
115 additions
and
18 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
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
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