Parent: #459
Problem
zig-js's Proxy and detached-buffer message tables read as V8-derived, not
JavaScriptCore-derived. Of 15 Proxy cases probed, 14 diverge; the only one that already
matches is new Proxy({}, null).
This is the same root cause as the JSON.stringify cyclic message fixed in 8ba5966,
which was emitting V8's Converting circular structure to JSON. Worth treating as a
class: wherever a message was written from memory rather than from a JSC differential,
it is likely V8's.
Every one of the 80 cases in this sweep threw in both engines, so the semantics are right and this is purely message text — with one exception noted below.
Proxy invariant traps (11 cases)
zig-js uses a lowercase uniform prefix; JSC's prefix varies per trap, so this needs a per-trap table rather than one rule:
zig-js: proxy 'get' must report ...
JSC: Proxy handler's 'get' result of ...
JSC: Proxy's 'defineProperty' trap returned true even though ...
JSC: Proxy object's 'isExtensible' trap returned true when ...JSC also interpolates the offending property name into the ownKeys omission message
(... the non-configurable property 'k' that was not in the result ...); zig-js does not.
Revoked proxy (3 cases) — a merge, not a split
JSC emits ONE string for every operation:
Proxy has already been revoked. No more operations are allowed to be performed on itzig-js parameterizes by trap (Cannot perform 'get'/'set'/'apply' on a proxy that has
been revoked). Collapsing to the single constant fixes all of them at once.
Detached buffers are over-partitioned (8 cases)
JSC uses exactly three strings across the whole surface:
| situation | JavaScriptCore |
|---|---|
| any operation on an existing view — TypedArray methods and DataView accessors alike | Underlying ArrayBuffer has been detached from the view or out-of-bounds |
| constructing a view over a detached buffer | Buffer is already detached |
ArrayBuffer.prototype.slice | Receiver is detached |
zig-js has at least four and splits TypedArray from DataView where JSC does not.
One real bug in that cluster
dv.subarray(0) on a detached view emits zig-js's construction message
(Cannot construct a TypedArray on a detached buffer) rather than its view-operation
message, because subarray is routed through the construction path and leaks that
wording. .sort / .slice / .fill correctly use the view message. That one is worth
fixing independently of the JSC alignment.
Verification
scratchpad/sweep/probe.sh diffs against a real JavaScriptCore backend. Drive probes
from inside a function — zig-js --eval runs script code, so an indirect eval shares
global scope with the harness.