Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.
This repository was archived by the owner on May 17, 2025. It is now read-only.

bug handling new ECMAScript findLastIndex() #217

@mminea

Description

@mminea

Since ECMAScript 2022 arrays have new methods like findLastIndex
I assume their handling in ElementaryJS is simply forwarded.
Every once in a while, findLastIndex returns false when looking for an existing array element (it correctly returns -1 when the element does not exist).
MWE (n=100 is sufficiently large to exhibit every few runs):

test("findLastIndex", () => {
  let a = [];
  for (let i = 0; i < 100; ++i) { a.push(Math.random()); }
  for (let i = 0; i < a.length; ++i) {
    assert(a.findLastIndex((e, _i, _a) => e === a[i]) !== false);
  }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions