Repository navigation
Update dependency Jint to 4.17.0 - #2393
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.16.4→4.17.0Release Notes
sebastienros/jint (Jint)
v4.17.0Jint 4.17.0 is a release from the
4.xbranch. It backports correctness and conformance fixes frommain(four of them for scripts that could end the host process), linear string building, and two new opt-in APIs for hosts. That is why it is a minor release rather than a patch. Nothing in it changes an existing API or an existing default, so it is a drop-in update from 4.16.4.Highlights
A pooled engine can let go of a finished request's objects. Hosts that reuse one engine across many evaluations (
CaptureGlobalSnapshotonce,RestoreGlobalSnapshotbetween runs) keep the interpreter's warmed caches, and that is the point of reusing it. But a warmed call site remembers the last function it called, and a warmed member read remembers the last object it read from. In a pooled web host, that can be a delegate built from a finished request's services, which then stay alive until the same script runs again. The newEngine.Advanced.DiscardInterpreterCaches()drops those caches, so the objects can be collected. The engine, its intrinsics and its global object stay as they are. The next run of each script rebuilds its cache, which costs roughly what a first run on a new engine costs, minus building the engine. A good place to call it is when an engine has been idle for a while, rather than after every use (#4229, from #4227).A host can carry its own state across
await. Jint now runs ECMAScript's HostMakeJobCallback and HostCallJobCallback steps for every promise reaction, every thenable job and theFinalizationRegistrycleanup callback. A host can take part through the newOptions.Host.JobCallbacks, which accepts aJobCallbackHookswithCapture,EnterandExitcallbacks. That lets each branch of aPromise.allfan-out keep its own host context, such as a logging scope or ambient request data, through everyawait(#4231, from #4230; issue #4200). The default is no hooks, in which case each promise registration costs one null check and nothing a script can observe changes.Four more ways for a script to end the host process are closed.
TypeErrorcopy from inside thecatchthat was handling the original failure. That added a nested exception dispatch at every hop, and no stack check could see it. Even with the stack-overflow guard on, a long chain of wrapped functions ended the process on the way back out, and a three-line script with anamegetter needed no chain at all. Building that copy also ran script (toString, getters, proxy traps); it no longer does. A failedimportValuenow reports the import failure instead of an unrelated error (#4220, from #4176 and #4183).instanceofandeval.instanceofnow checks the native stack before calling a customSymbol.hasInstancemethod, andevalchecks it before parsing. A self-referencingSymbol.hasInstance, orvar s = 'eval(s)'; eval(s), now raises aRangeErrorthe script can catch instead of ending the process. On theMaxExecutionStackCountpath,evalalso stopped hopping to a new thread at each overflow without ever throwing.instanceofover a bound function now consults every bound link's ownSymbol.hasInstance, as the specification requires (#4221, from #4172, #4184 and #4187).Options.Constraints.StackOverflowGuardis on, so turn it on for any script you do not fully trust.Building a string with
s = s + xis linear. A+whose result reaches 512 characters now produces a deferred string instead of copying both sides. Building withs = s + x,s = x + sands = s + a + btherefore becomes linear, ass += xalready was. Short concatenations take a separate path and pay nothing for this. The deferred string is safe to read from several engines that share onePrepared<Script>, and it is charged toLimitMemorywhen it is built, so a memory limit still bounds it. Binding an already-bound function also no longer copies its whole"bound …"name at every level (#4160, from #3386, #3571, #4130, #4164 and #4173).Array.prototype.concatspreads host arrays and lists. Since 4.14, CLR arrays and lists reach script as live views by default.concatadded such a view as a single element instead of spreading its items, soa.concat(b)returned the two wrappers. It now spreads anything script sees as an array (#4219, from #4216; issue #4201).TypedArray.prototype.withsurvives a shrinking coercion. When converting the index or the value made a resizable buffer shorter,withcopied past its new end and let a CLRArgumentExceptionescape. It now copies only what the buffer still holds (#4218, from #4157).Verification
Every backport was verified failing-first: its tests were run against the unfixed
4.xtree on .NET 10 and .NET Framework 4.7.2, then with the change. The release candidate was measured against 4.16.4 on SunSpider and Dromaeo in six paired rounds, alternating which build ran first in each round. The four DromaeoObjectRegExprows ran 12–15% faster and SunSpider's3d-raytrace2.3% faster. No row regressed by 1% or more; the two rows whose interval did not include zero (one DromaeoCubevariant, +0.70%, and SunSpider'scontrolflow-recursive, +0.88%) are within this machine's run-to-run noise.What's Changed
Full Changelog: sebastienros/jint@v4.16.4...v4.17.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.