Commit Graph
12 Commits
Author SHA1 Message Date
dotCooCoo ff165a7ec2 JavaScript: descriptor bags keep ECMAScript key order; Symbol hooks need ES2015
Object.defineProperties, Object.create, seal and freeze read an ordinary
object's own names in ECMAScript order (array indices ascending first) in
an ES2015 run, through proxies without an ownKeys trap too; without the
option they keep the order for-in visits.

concat reads Symbol.isConcatSpreadable and with scopes read
Symbol.unscopables only in an ES2015 run, so a Symbol set by an earlier
run does not change code run without the option.

Tests: the host-function proxy refusal checks the throw and that neither
the host function nor the trap ran; the bound-constructor test sets the
custom prototype before constructing.
2026-12-02 08:10:45 -08:00
dotCooCoo 337b47a309 JavaScript: with scopes honor Symbol.unscopables; concat reads isConcatSpreadable
- A `with` scope reads `Symbol.unscopables` after it finds a name, through
  a proxy's `get` trap, and skips the binding when that object's property
  for the name is truthy.
- `concat` reads `Symbol.isConcatSpreadable`, through proxy traps; a
  defined value decides whether the object is spread.
- `Object.keys` and `Object.getOwnPropertyNames` keep the target's order
  through empty-handler proxies.
- `%TypedArray%.from` and `of` construct through a proxy constructor and
  check that the result is a typed array long enough.
2026-12-02 06:23:12 -08:00
dotCooCoo b3c1a31cfa JavaScript: proxy checks follow GetFunctionRealm, subclass order and for-in sources
- A non-object `prototype` on `new.target` walks its bound and proxy chain
  (GetFunctionRealm), so a get trap that revokes the proxy throws a
  TypeError instead of running the constructor.
- A subclassable built-in such as Number no longer unwraps a revoked
  `new.target` before its own argument conversion runs.
- for-in records how many proxies came before the object that first listed
  each name, and the recheck does not ask those proxies for a descriptor, so
  a proxy that did not list a name cannot hide an inherited enumerable one.
- Names from an ownKeys trap take fuel for their code units, and so do the
  names the ownKeys invariant check hashes.
- The DataView argument test expects TypeError for a non-buffer and
  RangeError for a bad offset or length.
2026-12-01 09:06:27 -08:00
dotCooCoo fd50e7dba1 Scripts: proxies take Symbol keys through their traps
A Symbol key on a proxy read, wrote, tested, deleted and described the
proxy's own Symbol table, so the target never saw it and no trap ran.
Every Symbol path now resolves a proxy the way a string key does: the
get, set, has, deleteProperty, defineProperty and getOwnPropertyDescriptor
traps receive the Symbol, and without a trap the operation reaches the
target with its writable and accessor checks. A super write and a write
on a primitive that reach a proxy go through its [[Set]].

- ownKeys traps may return Symbols; a duplicate Symbol (by identity) or
  any other value is a TypeError, and the result is checked against the
  target's non-configurable and, for a non-extensible target, all keys
  of both kinds, in the target's own key order.
- Reflect.ownKeys lists Symbols, in the trap's order for a proxy, and
  Reflect's other functions take Symbol keys. Object.freeze, seal,
  isFrozen and isSealed include a proxy's Symbols instead of throwing.
- Symbol key lists stay rooted and charged to the heap until released.
- new Proxy and Proxy.revocable reject a revoked target or handler.
- A typed array reached on the prototype chain as the receiver converts
  the value for an index it lacks.
- The eval redeclaration test asserts the runtime SyntaxError.
2026-11-29 22:20:58 -08:00
dotCooCoo 94cbceb676 JavaScript: JSON reads proxy array lengths with ToLength and skips host indexers through transparent proxies, and proxies construct bound built-ins 2026-11-28 23:24:50 -08:00
dotCooCoo 8c7c3d9ead JavaScript: Map and Set built for another newTarget use its adder, and Reflect has its tag
Reflect.construct of Map, Set, WeakMap and WeakSet with another newTarget fills the collection through the new prototype's adder, new through an empty-handler proxy of a host class constructs the class, Reflect has Symbol.toStringTag, and an ownKeys result is read in full before a duplicate is refused.
2026-11-28 22:25:57 -08:00
dotCooCoo f3b3cbfe67 JavaScript: proxies keep revocation, namespace and collection rules, and key lists stay counted
A revoked proxy no longer gives its own Symbol properties, the reflect extension reads proxies without running traps, key lists a proxy gives stay counted against the heap while callers use them, has through a proxy of a host collection asks the collection, a proxy's invariant checks keep a namespace's uninitialized-export errors, and a binary constructor checks its arguments before it reads newTarget's prototype. Trap arguments stay rooted while a trap runs.
2026-11-28 22:16:56 -08:00
dotCooCoo 457661418b JavaScript: Reflect.ownKeys lists index keys first and proxy writes skip typed-array gaps
Reflect.ownKeys and a proxy without an ownKeys trap list integer-index keys in ascending order first. Reflect.construct takes another newTarget for Map, Set and typed arrays, for-in reads each proxy key's descriptor once, deleting a with binding runs only the deleteProperty trap, a write past a typed array's view on the prototype chain is ignored, and a target's descriptor stays reachable while a trap runs. The crate documentation states that traps take string keys only.
2026-11-28 21:56:29 -08:00
dotCooCoo af9709b16f JavaScript: proxies follow module namespaces, for-in key accounting and built-in construction
A proxy's descriptor and write paths honor a module namespace's uninitialized exports and read-only writes, for-in through proxies counts the keys it keeps against the heap limit, new through an empty-handler proxy of a built-in constructs it, and revoke has its standard name and length. Object.freeze, seal, isFrozen and isSealed throw a TypeError for a proxy whose target chain has Symbol properties.
2026-11-28 21:46:06 -08:00
dotCooCoo cfd6aed392 JavaScript: proxies keep their traps after the merge with main
Function.prototype.bind reads a proxy's prototype through its trap, Object.prototype.toString reads a proxy's Symbol.toStringTag from its target, Reflect.set writes a typed array's elements, a super assignment runs the set trap of a proxy on the home object's chain, and 'in' asks a proxy's has trap once. The name a trap is given is counted against the heap and fuel limits, and Proxy and Reflect stay reachable while their functions are installed.
2026-11-28 21:18:51 -08:00
dotCooCoo b0e8c2055f Merge main into feat/js-es2015-proxy-reflect-m
Proxies join main's construct path in class_ops.rs: new and Reflect.construct both run the construct trap there, with new.target passed through. A Symbol-key lookup passes through a proxy to its target, so spread and for-of read a proxy of an array with the array iterator.
2026-11-28 18:47:57 -08:00
dotCooCoo 9ab0a490ac JavaScript: Proxy and Reflect in ECMAScript 2015 realms
A realm made with Options::es2015 has Proxy, with Proxy.revocable, and
Reflect with its thirteen functions (ECMA-262 11th edition, sections
9.5, 26.1 and 26.2), with string property names. Every internal method
of an object goes through one dispatch, so a proxy's traps run for
property reads and writes, in, delete, for-in, the Object functions,
instanceof, calls and new, and when the proxy is a prototype or a with
object. Array.isArray, concat and JSON.stringify treat a proxy of an
array as an array.

- Each trap result is checked against the target's invariants, and a
  violation or an operation on a revoked proxy throws a TypeError.
- Traps take fuel and count against the limit on nested calls.
- A proxy given to a host function throws a TypeError naming the
  argument, without running its traps.
- Reflect.construct gives a built-in's result the prototype of
  newTarget, and Object with a different newTarget makes a new object.
- for-in skips a name deleted or made non-enumerable during the loop,
  and does not ask a has trap.
- Descriptor values a trap returns stay rooted while they are read.

script.run gives a .js file both globals; a .jsx file and a source
string have neither. cargo xtask test262 runs the suite's Proxy and
Reflect tests whose features are present.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-22 11:00:59 -08:00