Parent: #473
Problem
Error construction canonicalizes a JavaScript message before storing it, and callers may attach a string sourceURL plus startingLineNumber. Error.prototype.stack later materializes its first line and explicit eval location by reading those stored string Values through raw physical asStr bytes. With flat Latin-1 storage enabled, stack text can therefore depend on the StringData representation.
Scope
- Read an own string message through the representation-aware WTF-8 boundary when materializing the stack first line.
- Read an own string sourceURL through the same boundary before formatting the explicit eval location.
- Preserve the non-reentrant own-slot behavior, structured frame capture, stackTraceLimit, setter semantics, and source line numbering.
- Add one exact-coercion regression covering both message and sourceURL output under canonical and forced-flat storage.
This issue does not touch promises, jobs, queues, workers/threads, or Map/Set iterators.
Acceptance
- A Latin-1 message round-trips exactly in Error.prototype.stack.
- A Latin-1 explicit sourceURL round-trips exactly in the formatted eval location.
- Message coercion occurs exactly once during construction; stack access does not re-coerce it.
- Focused Debug, ReleaseSafe, and TSan tests pass, including forced-flat storage.
- Full sharded units report zero failures and zero leaks.
- The 35-file Test262 Error.prototype.stack subtree is measured before and after with exact flips.