v4.9.3
Highlights
Jint 4.9.3 is a maintenance release on top of 4.9.2 that closes the remaining test262 gaps from the 4.9.x line, hardens bulk built-ins against runaway inputs, and delivers large TypedArray performance gains. There are no public API surface changes, but host code that reads an error's stack should review the breaking-change note below, plus one additional minor behavioral note.
ECMAScript spec coverage
The bundled test262 suite was bumped to its latest snapshot and the spec gaps it surfaced were implemented — the full conformance suite now passes with 0 failures (#2489, #2490):
Error.prototype.stackaccessor (error-stack-accessor proposal) —stackis now a configurableget/setaccessor on%Error.prototype%rather than an own data property on each instance. This is a breaking change for host (C#) code that readsstack— see the breaking-change note below.- Immutable
ArrayBufferwrite rejection —%TypedArray%.prototypemutators (copyWithin/fill/reverse/set/sort), theAtomicsread-modify-write ops, andUint8ArraysetFromBase64/setFromHexnow throwTypeErrorbefore any observable side effect when the backing buffer is immutable. - Intl legacy-constructor mode (normative-optional) for
NumberFormatandDateTimeFormat, plus the newIntl.PluralRulescompactDisplayoption. Temporal.ZonedDateTime— rejects not-yet-adopted calendar annotations and correctly rounds to start-of-day when midnight occurs twice across a fall-back DST transition.- Source-phase import re-exports —
import source x from "…"; export { x };is now supported (#2490).
Performance
- TypedArray bulk operations were rewritten around
System.Array.Copy/Span<T>instead of per-element decode/encode loops.set,slice,copyWithin,with,fill,reverse,toReversed, and theindexOf/lastIndexOf/includesscans are now roughly 80×–350× faster with drastically lower allocations (#2488).
Robustness
- Bulk built-ins are now interruptible by execution constraints (#2487, fixes #2486). Operations such as
'x'.padStart(2147483647)orArray.from({ length: 50000000 }), along with theArray/%TypedArray%/RegExp/JSON/Stringbulk loops, now honorTimeoutInterval/MaxStatements/LimitMemoryand raise a catchableRangeErrorinstead of hanging or throwing an uncatchableOutOfMemoryException.
Correctness
- Custom regex engine: fixed flag
vpatterns that were incorrectly rejected (e.g./-/v,/&&/v,/[\!]/v) (#2481). - Corrected escaping of regexp patterns built at run-time via
new RegExp(...),RegExp(...),.compile(...),String.prototype.match, etc. (#2482).
⚠️ Breaking change — reading an error's stack from host code
The Error.prototype.stack accessor change above also affects host (C#) code that inspects an error's stack trace. Previously stack was an own data property of every error instance, so an own-property read found the trace directly. It is now a get/set accessor defined on %Error.prototype% and is no longer an own property of the instance (#2489).
As a result, reading the trace with ObjectInstance.TryGetValue("stack", out var v) now yields undefined. TryGetValue still walks the prototype chain and finds the accessor on %Error.prototype%, but it invokes the inherited getter with the prototype as the receiver instead of the original error instance. The prototype has no [[ErrorData]] internal slot, so the getter returns undefined and the captured trace is lost.
Read the value through the accessor-aware Get, which threads the correct receiver:
// before — now returns undefined
errorObject.TryGetValue("stack", out var stack);
// after — invokes the getter with the error instance as the receiver
var stack = errorObject.Get("stack");⚠️ Minor behavioral change
For .NET Regex objects exposed to the engine, JsRegExp.Source / ToString() now return the placeholder ?[native regex] instead of the raw .NET pattern — the .NET pattern was misleading because it isn't a valid JS pattern (#2482).
What's Changed
- Fix flag v bugs in custom regex engine by @adams85 in #2481
- Correct escaping of regexp patterns created at run-time by @adams85 in #2482
- Bump the all-dependencies group with 5 updates by @dependabot[bot] in #2485
- Make bulk built-ins interruptible by execution constraints (#2486) by @lahma in #2487
- Optimize TypedArray bulk operations with Span/Array.Copy by @lahma in #2488
- Update test262 suite and implement newly-surfaced features by @lahma in #2489
- Support re-exporting source-phase imports by @lahma in #2490
Full Changelog: v4.9.2...v4.9.3