Skip to content

Extend the abstract-operations tracer beyond conversion and equality #34

Description

@pavlof01

Context

apps/trace-service/src/server/operations.ts is a single registry: adding an operation is one entry plus its clauses in ecma-spec.html. It currently covers 9 unary conversions (ToNumber, ToNumeric, ToString, ToBoolean, ToPrimitive, ToObject, ToPropertyKey, ToLength, ToIndex) and 3 binary algorithms (IsLooselyEqual, IsStrictlyEqual, AbstractRelationalComparison).

That leaves out most of the operators people actually find confusing.

Proposal

Add, in rough order of payoff:

  • ApplyStringOrNumericBinaryOperator+ - * / % **, the operator behind [] + {}.
  • instanceofInstanceofOperator, OrdinaryHasInstance.
  • inHasProperty.
  • Iterator protocol: GetIterator, IteratorStep, IteratorValue — powers destructuring and spread.
  • BigInt mixing rules and the TypeError branches.
  • Template literals / ToString on objects with custom Symbol.toPrimitive.

Each entry needs its algos list, its clauses in ecma-spec.html, and a spec URL. Where the engine262 fork needs new instrumentation, that lands in the submodule branch first.

Acceptance criteria

  • Each new operation appears in GET /functions and traces end to end through the worker sandbox.
  • The spec panel highlights a real clause for every step the trace emits — no step without a matching anchor.
  • Presets and hint text on the relevant page mention the new operators.

Status

ApplyStringOrNumericBinaryOperator is in flight in the working tree and not merged. Remaining work on that first operator: commit the engine262 instrumentation to the fork branch and bump the gitlink, fix operator-splitting for left-associative chains, cover the BigInt branch with a spec clause, and update the hint text and presets on /equality.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendAPI, sandbox, engine integrationenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions