[Webkit-unassigned] [Bug 278070] New: [JSC] Use for-of instead of for-in in stress tests for Temporal.Duration

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 13 18:05:27 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=278070

            Bug ID: 278070
           Summary: [JSC] Use for-of instead of for-in in stress tests for
                    Temporal.Duration
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: aosukeke at gmail.com

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240814/55dd2d86/attachment.htm>


More information about the webkit-unassigned mailing list