Repository navigation
Conversation
Summary: Add HermesSandboxRuntime to runtimeGenerators() in APITestFactory.cpp, so HermesUnitTests runs the parameterized HermesRuntimeTest cases on the sandbox as well, like the legacy Hermes API tests do. Until now no static_h test ran the sandbox. The sandbox does not support everything HermesRuntime does, so the tests skip what it lacks, with the same dynamic_cast<HermesSandboxRuntime *> checks the file already uses: - instrumentation(): GetHeapInfo and ExternalMemoryNoOpTest. - ArrayBuffers created from a MutableBuffer: the rest of TryGetMutableBuffer after its first check, and TryGetMutableBufferAfterHiddenClassTransition. - createValueFromJsonUtf8 is the default implementation, which calls the global JSON.parse: CreateValueFromJsonUtf8IgnoresGlobalJSON. - utf16() converts through UTF-8, which turns lone surrogates into U+FFFD: the lone surrogate checks at the end of UTF16ConversionTest and CreateFromUtf16Test. The sandbox implements neither ISerialization nor Worker, so HermesSerializationTest and HermesWorkerTest run on the new hermesRuntimeGenerators(), which returns just the two HermesRuntime factories. The same factory backs JSITests-SHTrunk, JSITestsUnstable-SHTrunk and JSIDynamicTests-SHTrunk in xplat/jsi, FBJSValueTests-SHTrunk on Apple, and the CMake APITests, so those now run on the sandbox too. In testlib, ArrayBufferDetachedTest assumed that a runtime with ArrayBuffer.prototype.detached can also detach a buffer from JS. The sandbox has neither transfer() nor HermesInternal.detachArrayBuffer, so the test now stops after its first check in that case. The CMake sanitizer jobs build with Clang's UBSan, whose function type check aborts on the generated code's indirect calls: they pass the instance as void * to functions defined with a typed instance pointer. Nothing ran the sandbox before, so this never fired. Build the generated C with -fno-sanitize=function under Clang. Changelog: [Internal] Differential Revision: D125561036
|
@lavenzg has exported this pull request. If you are a Meta employee, you can view the originating Diff in D125561036. |
meta-codesync Bot
pushed a commit
to facebook/hermes
that referenced
this pull request
Oct 22, 2026
Summary: X-link: react/react-native#59238 Add HermesSandboxRuntime to runtimeGenerators() in APITestFactory.cpp, so HermesUnitTests runs the parameterized HermesRuntimeTest cases on the sandbox as well, like the legacy Hermes API tests do. Until now no static_h test ran the sandbox. The sandbox does not support everything HermesRuntime does, so the tests skip what it lacks, with the same dynamic_cast<HermesSandboxRuntime *> checks the file already uses: - instrumentation(): GetHeapInfo and ExternalMemoryNoOpTest. - ArrayBuffers created from a MutableBuffer: the rest of TryGetMutableBuffer after its first check, and TryGetMutableBufferAfterHiddenClassTransition. - createValueFromJsonUtf8 is the default implementation, which calls the global JSON.parse: CreateValueFromJsonUtf8IgnoresGlobalJSON. - utf16() converts through UTF-8, which turns lone surrogates into U+FFFD: the lone surrogate checks at the end of UTF16ConversionTest and CreateFromUtf16Test. The sandbox implements neither ISerialization nor Worker, so HermesSerializationTest and HermesWorkerTest run on the new hermesRuntimeGenerators(), which returns just the two HermesRuntime factories. The same factory backs JSITests-SHTrunk, JSITestsUnstable-SHTrunk and JSIDynamicTests-SHTrunk in xplat/jsi, FBJSValueTests-SHTrunk on Apple, and the CMake APITests, so those now run on the sandbox too. In testlib, ArrayBufferDetachedTest assumed that a runtime with ArrayBuffer.prototype.detached can also detach a buffer from JS. The sandbox has neither transfer() nor HermesInternal.detachArrayBuffer, so the test now stops after its first check in that case. The CMake sanitizer jobs build with Clang's UBSan, whose function type check aborts on the generated code's indirect calls: they pass the instance as void * to functions defined with a typed instance pointer. Nothing ran the sandbox before, so this never fired. Build the generated C with -fno-sanitize=function under Clang. Changelog: [Internal] Reviewed By: avp Differential Revision: D125561036 fbshipit-source-id: 65d82faf50745489321a04a3b12162d3f4983be4
meta-codesync Bot
pushed a commit
to facebook/hermes
that referenced
this pull request
Oct 22, 2026
Summary: X-link: react/react-native#59238 Add HermesSandboxRuntime to runtimeGenerators() in APITestFactory.cpp, so HermesUnitTests runs the parameterized HermesRuntimeTest cases on the sandbox as well, like the legacy Hermes API tests do. Until now no static_h test ran the sandbox. The sandbox does not support everything HermesRuntime does, so the tests skip what it lacks, with the same dynamic_cast<HermesSandboxRuntime *> checks the file already uses: - instrumentation(): GetHeapInfo and ExternalMemoryNoOpTest. - ArrayBuffers created from a MutableBuffer: the rest of TryGetMutableBuffer after its first check, and TryGetMutableBufferAfterHiddenClassTransition. - createValueFromJsonUtf8 is the default implementation, which calls the global JSON.parse: CreateValueFromJsonUtf8IgnoresGlobalJSON. - utf16() converts through UTF-8, which turns lone surrogates into U+FFFD: the lone surrogate checks at the end of UTF16ConversionTest and CreateFromUtf16Test. The sandbox implements neither ISerialization nor Worker, so HermesSerializationTest and HermesWorkerTest run on the new hermesRuntimeGenerators(), which returns just the two HermesRuntime factories. The same factory backs JSITests-SHTrunk, JSITestsUnstable-SHTrunk and JSIDynamicTests-SHTrunk in xplat/jsi, FBJSValueTests-SHTrunk on Apple, and the CMake APITests, so those now run on the sandbox too. In testlib, ArrayBufferDetachedTest assumed that a runtime with ArrayBuffer.prototype.detached can also detach a buffer from JS. The sandbox has neither transfer() nor HermesInternal.detachArrayBuffer, so the test now stops after its first check in that case. The CMake sanitizer jobs build with Clang's UBSan, whose function type check aborts on the generated code's indirect calls: they pass the instance as void * to functions defined with a typed instance pointer. Nothing ran the sandbox before, so this never fired. Build the generated C with -fno-sanitize=function under Clang. Changelog: [Internal] Reviewed By: avp Differential Revision: D125561036 fbshipit-source-id: 65d82faf50745489321a04a3b12162d3f4983be4
meta-codesync Bot
pushed a commit
to facebook/hermes
that referenced
this pull request
Oct 22, 2026
Summary: X-link: react/react-native#59238 Add HermesSandboxRuntime to runtimeGenerators() in APITestFactory.cpp, so HermesUnitTests runs the parameterized HermesRuntimeTest cases on the sandbox as well, like the legacy Hermes API tests do. Until now no static_h test ran the sandbox. The sandbox does not support everything HermesRuntime does, so the tests skip what it lacks, with the same dynamic_cast<HermesSandboxRuntime *> checks the file already uses: - instrumentation(): GetHeapInfo and ExternalMemoryNoOpTest. - ArrayBuffers created from a MutableBuffer: the rest of TryGetMutableBuffer after its first check, and TryGetMutableBufferAfterHiddenClassTransition. - createValueFromJsonUtf8 is the default implementation, which calls the global JSON.parse: CreateValueFromJsonUtf8IgnoresGlobalJSON. - utf16() converts through UTF-8, which turns lone surrogates into U+FFFD: the lone surrogate checks at the end of UTF16ConversionTest and CreateFromUtf16Test. The sandbox implements neither ISerialization nor Worker, so HermesSerializationTest and HermesWorkerTest run on the new hermesRuntimeGenerators(), which returns just the two HermesRuntime factories. The same factory backs JSITests-SHTrunk, JSITestsUnstable-SHTrunk and JSIDynamicTests-SHTrunk in xplat/jsi, FBJSValueTests-SHTrunk on Apple, and the CMake APITests, so those now run on the sandbox too. In testlib, ArrayBufferDetachedTest assumed that a runtime with ArrayBuffer.prototype.detached can also detach a buffer from JS. The sandbox has neither transfer() nor HermesInternal.detachArrayBuffer, so the test now stops after its first check in that case. The CMake sanitizer jobs build with Clang's UBSan, whose function type check aborts on the generated code's indirect calls: they pass the instance as void * to functions defined with a typed instance pointer. Nothing ran the sandbox before, so this never fired. Build the generated C with -fno-sanitize=function under Clang. Changelog: [Internal] Reviewed By: avp Differential Revision: D125561036 fbshipit-source-id: 65d82faf50745489321a04a3b12162d3f4983be4
Collaborator
|
This pull request was successfully merged by @lavenzg in 05a2e4c When will my fix make it into a release? | How to file a pick request? |
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:
Add HermesSandboxRuntime to runtimeGenerators() in APITestFactory.cpp,
so HermesUnitTests runs the parameterized HermesRuntimeTest cases on
the sandbox as well, like the legacy Hermes API tests do. Until now no
static_h test ran the sandbox.
The sandbox does not support everything HermesRuntime does, so the
tests skip what it lacks, with the same
dynamic_cast<HermesSandboxRuntime *> checks the file already uses:
TryGetMutableBuffer after its first check, and
TryGetMutableBufferAfterHiddenClassTransition.
the global JSON.parse: CreateValueFromJsonUtf8IgnoresGlobalJSON.
U+FFFD: the lone surrogate checks at the end of UTF16ConversionTest
and CreateFromUtf16Test.
The sandbox implements neither ISerialization nor Worker, so
HermesSerializationTest and HermesWorkerTest run on the new
hermesRuntimeGenerators(), which returns just the two HermesRuntime
factories.
The same factory backs JSITests-SHTrunk, JSITestsUnstable-SHTrunk and
JSIDynamicTests-SHTrunk in xplat/jsi, FBJSValueTests-SHTrunk on Apple,
and the CMake APITests, so those now run on the sandbox too. In
testlib, ArrayBufferDetachedTest assumed that a runtime with
ArrayBuffer.prototype.detached can also detach a buffer from JS. The
sandbox has neither transfer() nor HermesInternal.detachArrayBuffer,
so the test now stops after its first check in that case.
The CMake sanitizer jobs build with Clang's UBSan, whose function
type check aborts on the generated code's indirect calls: they pass
the instance as void * to functions defined with a typed instance
pointer. Nothing ran the sandbox before, so this never fired. Build
the generated C with -fno-sanitize=function under Clang.
Changelog: [Internal]
Differential Revision: D125561036