Skip to content

v0.0.7

Choose a tag to compare

@MagicalTux MagicalTux released this 04 Jul 14:21
· 628 commits to master since this release
aa866fa

Added

  • (promise) Promise[Symbol.species] getter → subclass then/catch chaining (§3.6)
  • (promise) Promise subclassing — class P extends Promise (§3.6)

Fixed

  • (string) String-exotic getOwnPropertyDescriptor + getOwnPropertyNames (§3.6)
  • (string) String index properties are enumerable (propertyIsEnumerable) (§3.6)
  • (string) String exotic objects expose own index/length to has_own (§3.6)
  • (bigint) a BigInt primitive's [[Prototype]] is %BigInt.prototype% (§3.6)
  • (typedarray) array-like constructor uses ToLength (empty, not RangeError) (§3.6)
  • (array) toSpliced coerces start/deleteCount via ToIntegerOrInfinity (§3.6)
  • (array) slice coerces start/end via ToIntegerOrInfinity (§3.6)
  • (array) fill/flat/copyWithin coerce index args via ToIntegerOrInfinity (§3.6)
  • (array) splice coerces start/deleteCount via ToIntegerOrInfinity (§3.6)
  • (array) copyWithin runs spec-precise algorithm for hole/accessor arrays (§3.6)
  • (array) reverse runs spec-precise algorithm for hole/accessor arrays (§3.6)
  • (array) sort runs spec-precise SortIndexedProperties for hole/accessor arrays (§3.6)
  • (arraybuffer) slice allocates via SpeciesConstructor (§3.6)
  • (arraybuffer) install ArrayBuffer[Symbol.species] getter (§3.6)
  • (proxy) Reflect.set trapless chain to an ordinary getter-only accessor → false (§3.6)
  • (string) split ToStrings separator before limit-0; nbvm faults object sep (§3.6)
  • (string) String.raw validates template/raw with throwing ToObject (§3.6)
  • (string) replace/replaceAll ToString the replacement value (§3.6)
  • (functions) Function constructor ToString's its arguments (§3.6)
  • (proxy) computed [[Set]] runs parent.[[Set]] through a proxy/setter proto (§3.6)
  • (proxy) Reflect.set on a proxy target returns the real [[Set]] boolean (§3.6)
  • (with) with-statement HasBinding consults the proxy has trap (§3.5)
  • (array) flat/flatMap use ArraySpeciesCreate + CreateDataPropertyOrThrow (§3.6)
  • (array) flat/flatMap skip absent array-like indices (HasProperty) (§3.6)
  • (array) array holes are absent to in/HasProperty; flat skips holes (§3.6)
  • (array) Array.of honors a constructor this (§3.7)
  • (proxy) Reflect.set with a proxy receiver writes via [[DefineOwnProperty]] (§3.6)
  • (proxy) a proxy write target runs its own [[Set]], not the cell gate (§3.6)
  • (proxy) Reflect.ownKeys forwards trapless [[OwnPropertyKeys]] to target (§3.7)
  • (proxy) JSON.stringify + getOwnPropertyDescriptors enumerate proxies (§3.7)
  • (proxy) object-rest patterns run proxy-aware CopyDataProperties (§3.7)
  • (proxy) object spread enumerates a proxy source via its traps (§3.7)
  • (proxy) route HasProperty through the proxy trap in array-like iteration (§3.7)

Other

  • record the puremp BigInt-backend migration (CHANGELOG + ROADMAP §8)
  • (bignum) back BigInt with puremp::Int (§8 reused-crate)
  • fix string_exotic_own test — in on a string primitive throws
  • (test262) remove 33 now-passing ledger entries (array precise mutators + ArrayBuffer species)
  • (test262) remove 30 now-passing ledger entries (Promise subclassing + species)
  • fix public->private intra-doc link in promise_state
  • (roadmap) note puremp as the BigInt-layer backend candidate (§8)
  • lower MSRV to Rust 1.88
  • (test262) remove 31 more now-passing ledger entries (49 total this batch)
  • (test262) remove 18 now-passing ledger entries (proxy/Array.of/JSON)
  • (roadmap) record proxy-conformance progress + refresh pass-rate (§3.7)

Added

  • (promise) class P extends Promise {} subclassing — super(executor) now
    runs the executor and backs the (ordinary-object) subclass instance with a
    hidden [[PromiseState]] cell that promise_state follows, so construction,
    the static combinators (P.resolve/all/race/allSettled/…), then/catch,
    await, and microtask delivery all work on a subclass instance (a non-callable
    executor is a TypeError).
  • (promise) Promise[Symbol.species] — Promise now carries the shared species
    getter (returns this), so Promise[Symbol.species] === Promise, a subclass
    inherits it (class P extends Promise {} → P[Symbol.species] === P), and
    then/catch produce subclass instances via SpeciesConstructor (an explicit
    @@species override is still honored) (ROADMAP §3.6 Promise).

Changed

  • (bignum) BigInt is now backed by puremp
    (the Karpelès Lab pure-Rust multi-precision maths crate) instead of the
    in-house arbitrary-precision integer: src/bignum.rs is a thin wrapper
    (pub struct BigInt(puremp::Int)) preserving the prior API, so Cell::BigInt
    and every call site are unchanged. Added default-features = false, features = ["int"] (no_std + alloc, MSRV 1.88). Truncated div_rem,
    two's-complement bit ops, mod_2k (BigInt64Array wrapping), and write_radix
    map directly; verified against the full bignum test module and the BigInt
    Test262 semantics (ROADMAP §8).

Fixed

  • (array) Array.prototype.sort runs the spec-precise SortIndexedProperties
    when the array has hole or accessor-override indices: it collects present
    elements via [[Get]] (index getters fire), sorts them, writes the sorted
    values back via [[Set]] (setters fire), and DeletePropertyOrThrows the
    trailing indices. Dense arrays and typed arrays keep the fast in-memory sort
    (ROADMAP §3.6).
  • (arraybuffer) ArrayBuffer[Symbol.species] getter is installed (returns
    this, so a subclass inherits it), and ArrayBuffer.prototype.slice allocates
    its result via SpeciesConstructor(O, %ArrayBuffer%) — a subclass instance for
    a subclass receiver, a non-constructor species is a TypeError, and the result
    is validated as a distinct ArrayBuffer of sufficient length (ROADMAP §3.6).
  • (string) String.prototype.split runs ToString(separator) before the
    limit === 0 short-circuit (a throwing separator toString throws even at
    limit 0), and the bytecode VM faults an object/Symbol/wrapper separator (or an
    object limit) to the tree-walker so a custom toString/@@split and RegExp
    delegation are honored — previously "axbxc".split({toString:()=>"x"}) did not
    split under nbvm (ROADMAP §3.6, §6 two-engines-one-truth).
  • (string) String.raw uses throwing ToObject on the template and on
    Get(template, "raw") (a null/undefined or a non-object raw throws
    TypeError), and reads raw via Get so an inherited getter fires and its
    throw propagates — previously all silently succeeded (ROADMAP §3.6).
  • (string) String.prototype.replace/replaceAll ToString the replacement
    value and the function-replacer's result (a custom toString/@@toPrimitive
    runs and a thrown value propagates) instead of rendering "[object Object]"
    (ROADMAP §3.6).
  • (functions) the Function constructor ToStrings each argument
    (CreateDynamicFunction): a custom toString/valueOf runs and a thrown value
    propagates — new Function({toString(){throw 1}}, "") throws 1 instead of
    stringifying to "[object Object]" and failing to parse (ROADMAP §3.6).
  • (proxy) a computed write (o[k]=v, arr[i]=v) whose own slot is absent
    now runs parent.[[Set]] — an inherited setter, or a proxy on the prototype
    chain, handles it (with Receiver = the object) — matching the dot-key
    assign_member path. So Object.setPrototypeOf(arr, proxyWithSetTrap); arr[0]=v
    fires the trap instead of silently creating an own index. Default-%Array. prototype% arrays and present indices keep the dense fast path (ROADMAP §3.6).
  • (with) the with object-environment HasBinding is a proxy-aware
    HasProperty, so with (new Proxy(o, {has(){…}})) { name } consults the has
    trap (a trapless proxy forwards to its target) instead of throwing a spurious
    ReferenceError; @@unscopables still applies (ROADMAP §3.5).
  • (array) sparse-array holes are absent to in / HasProperty: the proxy-
    aware [[HasProperty]] used a bare i < length test that reported a hole as
    present, so 1 in [2,,3], 0 in new Array(3), [2,,3].hasOwnProperty(1),
    and the generic array-like iteration (forEach/map/… presence probe) all
    counted holes. Now hole-aware (via has_own). Array.prototype.flat/
    flatMap also skip holes (FlattenIntoArray uses HasProperty) (ROADMAP §3.6).
  • (array) Array.prototype.flat/flatMap on a generic array-like skip absent
    indices per FlattenIntoArray's HasProperty check (so a poisoned getter past
    length is never read), and flatMap passes the source object as the
    callback's 3rd argument (ROADMAP §3.6).
  • (array) Array.prototype.flat/flatMap build the result with
    ArraySpeciesCreate(O, 0) + CreateDataPropertyOrThrow — a non-constructor
    @@species (or a non-extensible/non-configurable target) now throws a
    TypeError, and a subclass species is honored (ROADMAP §3.6).
  • (array) Array.of honors a constructor this (Array.of.call(C, …) /
    subclass C.of(…)) — Construct(C, «len») + CreateDataPropertyOrThrow —
    instead of always building a plain %Array% (ROADMAP §3.7).
  • (proxy) route HasProperty through the proxy has trap in generic
    array-like iteration, so [...new Proxy([1,2,3],{})], Array.from(proxy),
    and Array.prototype.*.call(proxy, …) observe the proxied elements instead
    of reading holes (ROADMAP §3.7).
  • (proxy) object spread ({...proxy}, CopyDataProperties) enumerates a proxy
    source through its ownKeys/getOwnPropertyDescriptor/get traps (strings
    and symbols, enumerable only) instead of copying nothing (ROADMAP §3.7).
  • (proxy) object-rest patterns ({...rest} in a binding, assignment target,
    function parameter, or generator step) run the same proxy-aware
    CopyDataProperties, sharing one copy_data_properties helper; this also fixes
    symbol own keys being dropped from object rest on ordinary objects.
  • (proxy) JSON.stringify enumerates a proxy through its ownKeys/
    getOwnPropertyDescriptor/get protocol (a proxy over an array serializes as
    an array via IsArray), and Object.getOwnPropertyDescriptors drives the
    proxy's [[GetOwnProperty]] — both previously returned {} (ROADMAP §3.7).
  • (proxy) Reflect.ownKeys on a trap-less proxy forwards [[OwnPropertyKeys]]
    to the target instead of returning [] (ROADMAP §3.7).
  • (proxy) a proxy used as a write target (Object.assign(new Proxy({},{}), …)) runs its own [[Set]] (set trap / trapless forward) instead of the
    cell-level extensibility gate wrongly throwing "object is not extensible"
    (ROADMAP §3.6).
  • (proxy) Reflect.set with a proxy receiver — the ubiquitous passthrough
    set(t,k,v,r){ return Reflect.set(t,k,v,r) } — now writes to the receiver via
    [[DefineOwnProperty]] per OrdinarySetWithOwnDescriptor (not [[Set]], which
    recursed / hit the cell gate), so the write persists; non-writable/accessor
    targets reject and an ordinary receiver is unchanged (ROADMAP §3.6).