Bug 278070
Summary: | [JSC] Use for-of instead of for-in in stress tests for Temporal.Duration | ||
---|---|---|---|
Product: | WebKit | Reporter: | Sosuke Suzuki <aosukeke> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Sosuke Suzuki
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
Pull request: https://github.com/WebKit/WebKit/pull/32159
EWS
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
<rdar://problem/133899774>