frostney / frostney/GocciaScript

Track pending Iterator take/drop RangeError semantics from tc39/ecma262#3776

Open
#1,070 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

engine internal spec compliance
Dominant language
Pascal
Stars
20
Forks
3
Avg merge
3d 4h
Merged PRs (30d)
45

Description

Summary

Track the pending Iterator.prototype.take / Iterator.prototype.drop limit semantics from tc39/ecma262#3776 so GocciaScript follows the normative result rather than treating the current Test262 failures as a confirmed engine regression.

Why

The conformance dashboard should distinguish an implementation defect from an upstream suite/spec ordering gap. Implementing the currently failing assertions immediately would move GocciaScript ahead of the published ECMA-262 algorithm while the normative change remains unresolved.

Current behavior

At ECMA-262 main snapshot 994b48ed0c0940edaa0e4ce4d9e358fa3ba91edb, the take and drop algorithms reject NaN and negative limits but do not reject finite values above Number.MAX_SAFE_INTEGER:

The approved but still-open normative PR tc39/ecma262#3776 adds a RangeError for finite limits above 2**53 - 1 and changes iterator-helper counters to Numbers:

Test262 merged those assertions first in tc39/test262#5065:

Against pinned Test262 SHA b363f29d3c43c626dc852744ad64a0b48a003693, current main fails six tests under take and drop:

  • argument-effect-order.js
  • argument-validation-failure-closes-underlying.js
  • limit-rangeerror.js

The failures all reduce to the pending large-finite-limit behavior. The latest retained main artifact is CI run 30980196951. Local filtered bytecode runs reproduce 30/33 passing for take and 31/34 for drop with the same three failures per method.

Relevant implementation paths:

  • source/units/Goccia.Values.IteratorValue.pas
  • IteratorLimitArgOrClose
  • TGocciaIteratorValue.IteratorTake
  • TGocciaIteratorValue.IteratorDrop

Expected behavior

  • Track the disposition of tc39/ecma262#3776.
  • If the normative change lands, implement the finalized counter and range semantics and add focused local coverage in interpreted and bytecode modes.
  • If the normative change is revised or rejected, update the Test262 baseline/pin only with corresponding upstream evidence.
  • Keep release reporting explicit that these six failures are currently caused by Test262 advancing ahead of published ECMA-262.

Scope notes

This issue does not currently establish a GocciaScript regression. Do not change iterator semantics solely to make the six tests green before the upstream normative contract is settled.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading IteratorLimitArgOrClose, TGocciaIteratorValue.IteratorTake, and IteratorDrop in source/units/Goccia.Values.IteratorValue.pas, then reproduce the filtered Test262 runs for take and drop. Check tc39/ecma262#3776 and tc39/test262#5065 before changing behavior. Done means recording the upstream disposition and, if finalized, adding the required semantics and focused interpreted and bytecode coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.