Skip to content

New three-way string comparison instruction similar to std::strcmp in C++ #58

Open
@Liedtke

Description

@Liedtke

For performance evaluations we added the following instruction to v8 (change) and it might make sense to add it to the stringref proposal:

  • string.compare [0xfba8]
  • returns -1, 0 or 1 if the compared strings are lessThan, equal or greaterThan
  • traps if either of the inputs is null

The instruction does not use locale-specific comparisons but behaves like the operator < / > in JavaScript to determine the order.

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