Skip to content

[pull] main from oven-sh:main - #10

Merged
pull[bot] merged 2 commits into
coleleavitt:mainfrom
oven-sh:main
Jul 24, 2026
Merged

pull[bot] merged 2 commits into
coleleavitt:mainfrom
oven-sh:main

Conversation

@pull

@pull pull Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )


Summary by cubic

Fixes exception-scope handling in inspector host functions to stop “Unchecked JS exception” aborts during Runtime.evaluate. Hardens JSON parsing to fail gracefully on long-string OOM by throwing a RangeError instead of crashing.

  • Bug Fixes
    • Inspector: Release ThrowScope before tail-calling in JSInjectedScriptHostPrototype.cpp and JSJavaScriptCallFramePrototype.cpp using RELEASE_AND_RETURN(scope, ...), preventing false “Unchecked JS exception” under validateExceptionChecks=1.
    • JSON parsing: Long string values now allocate with StringImpl::tryCreateUninitialized; failures return nullptr via tryMakeJSString and surface in LiteralParser::parsePrimitiveValue, which now throws “RangeError: Out of memory.”

Written for commit 1acceb9. Summary will update on new commits.

Review in cubic

robobun added 2 commits July 24, 2026 00:16
…cript prototype host functions (#328)

Every host function in JSInjectedScriptHostPrototype.cpp and
JSJavaScriptCallFramePrototype.cpp declares a ThrowScope (for the
dynamicDowncast type error) and then tail-calls into a
JSInjectedScriptHost / JSJavaScriptCallFrame member that itself
declares a ThrowScope. Under validateExceptionChecks=1 this aborts
with 'Unchecked JS exception' because the outer scope is never
released before the inner one is created.

Observed in Bun with any Runtime.evaluate over an inspector
connection:

  ERROR: Unchecked JS exception:
      This scope can throw a JS exception: evaluateWithScopeExtension @ JSInjectedScriptHost.cpp:120
      But the exception was unchecked as of this scope: jsInjectedScriptHostPrototypeFunctionEvaluateWithScopeExtension @ JSInjectedScriptHostPrototype.cpp:275

Wrap every tail return in RELEASE_AND_RETURN(scope, ...) so the
outer scope is released before the callee may create its own.
…ue (#317)

* LiteralParser: throw RangeError on OOM when copying a JSON string value

JSONAtomStringCache::makeJSString called String(characters) for string
values longer than 16 chars. That constructor goes through
StringImpl::createUninitializedInternalNonEmpty -> StringImplMalloc::malloc,
which is the crash-or-succeed allocator. Parsing a JSON string value that
cannot be allocated killed the process.

Use StringImpl::tryCreateUninitialized and surface a null result up
through LiteralParser::parsePrimitiveValue, which now throws the same
RangeError: Out of memory that String.prototype.repeat and friends throw.

* Rename makeJSString to tryMakeJSString

Follows the JSC convention of prefixing try- on functions that return
nullptr on allocation failure (tryCreateUninitialized, tryMakeString).
@pull pull Bot locked and limited conversation to collaborators Jul 24, 2026
@pull pull Bot added the ⤵️ pull label Jul 24, 2026
@pull
pull Bot merged commit 1acceb9 into coleleavitt:main Jul 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant