From cd6755f2720dd6787545834ffd83905fd2d7517b Mon Sep 17 00:00:00 2001 From: Neil Dhar Date: Mon, 15 Jan 2024 16:25:42 -0800 Subject: [PATCH] Run API tests against the sandbox runtime (#42264) Summary: X-link: https://github.com/facebook/hermes/pull/1248 Pull Request resolved: https://github.com/facebook/react-native/pull/42264 Add a buck build for the sandbox, and run our existing API tests against it. Reviewed By: avp Differential Revision: D48086019 fbshipit-source-id: 2ee2eca93e27557d2609eaaec2fce3218d8b873f --- .../react-native/ReactCommon/jsi/jsi/test/testlib.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp b/packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp index abb008e1642..8291d428b35 100644 --- a/packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp +++ b/packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp @@ -1444,8 +1444,13 @@ TEST_P(JSITest, ArrayBufferSizeTest) { auto ab = eval("var x = new ArrayBuffer(10); x").getObject(rt).getArrayBuffer(rt); EXPECT_EQ(ab.size(rt), 10); - // Ensure we can safely write some data to the buffer. - memset(ab.data(rt), 0xab, 10); + + try { + // Ensure we can safely write some data to the buffer. + memset(ab.data(rt), 0xab, 10); + } catch (const JSINativeException& ex) { + // data() is unimplemented by some runtimes, ignore such failures. + } // Ensure that setting the byteLength property does not change the length. eval("Object.defineProperty(x, 'byteLength', {value: 20})");