Repository navigation
feat: host-callback budget, realm reset, and native async/await - #3
Merged
Merged
Conversation
Fix four embed holes that show up in MV3 and other long-lived hosts: - Inline null/undefined property errors so the published runtime throws JSVMTypeError instead of ReferenceError: Cannot is not defined - Give host-invoked guest callbacks the JSVM timeout and maxDepth - Add JSVM.reset() and resetOnExec so sequential execs do not leak vars - Compile async/await as a fiber AWAIT opcode (ISA 2) instead of inlined regenerator helpers
Coverage Report for CI Build 31947083295Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+1.4%) to 81.71%Details
Uncovered Changes
Coverage Regressions2 previously-covered lines in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
ximing
added a commit
that referenced
this pull request
Aug 20, 2026
feat: host-callback budget, realm reset, and native async/await
ximing
added a commit
that referenced
this pull request
Aug 25, 2026
feat: host-callback budget, realm reset, and native async/await
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.
Summary
Four runtime holes that show up when embedding jsvm3 in a long-lived host (MV3 service worker, content script, and similar):
null.foocrashed the host.Cannot/propertywere only imported under@ifdef COMPILER, so the minified runtime threwReferenceError: Cannot is not defined. Error strings are now literals; guesttry/catchworks.chrome.*/later(cb)creatednew Fiber(realm)withtimeout = -1. Fibers now inheritJSVMdefaultTimeout/maxDepth.execs. SameJSVMreused for the next message kept guestvars andmodule.exports. Addedvm.reset()andnew JSVM(host, { resetOnExec: true }).async/awaitwas a Babel accident.convertES5inlined_asyncToGenerator/_regenerator. Compiler now leavesasync/await; runtime has a fiber-nativeAWAITopcode (ISA 2). Old format 0 / opcode 1 artifacts still load.Test plan
npx jest— 330 passednpm run typecheckscripts/check-runtime-bundle.mjsafter rebuild (16 KB raw / 6 KB gzip)dist/runtimesmoke:null.foo,resetOnExec, callback timeout,awaithost Promise