WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
278070
[JSC] Use for-of instead of for-in in stress tests for Temporal.Duration
https://bugs.webkit.org/show_bug.cgi?id=278070
Summary
[JSC] Use for-of instead of for-in in stress tests for Temporal.Duration
Sosuke Suzuki
Reported
2024-08-13 18:05:27 PDT
In `stress/temporal-duration.js`, a `for-in` loop is used as follows: ```javascript const badStrings = [ '', '+', '+P', '-P', '+-P', 'P', 'P1', 'PT', 'P1YT', 'PT1', 'PT20.S', 'PT.20S', 'P1W1Y', 'PT1S1M', 'P1.1Y', 'PT1.1H1M', 'PT1.1M1S', 'PT1.1111111111H', 'PT1.1111111111M', 'PT1.1111111111S', `P${Array(309).fill(9).join('')}Y` ]; for (const badString in badStrings) shouldThrow(() => Temporal.Duration.from(badString), RangeError); ``` Since `badString` becomes the index of the array, this test will pass regardless of the values.
Attachments
Add attachment
proposed patch, testcase, etc.
Sosuke Suzuki
Comment 1
2024-08-13 18:13:55 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/32159
EWS
Comment 2
2024-08-14 18:47:11 PDT
Committed
282271@main
(c5784413c960): <
https://commits.webkit.org/282271@main
> Reviewed commits have been landed. Closing PR #32159 and removing active labels.
Radar WebKit Bug Importer
Comment 3
2024-08-14 18:48:13 PDT
<
rdar://problem/133899774
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug