Skip to content

Commit fd691d8

Browse files
authored
Re-sync with internal (#29778)
fbshipit-source-id: 65e2766a6a097eca0e0d0fda8dadf6871e9276c2
1 parent 1270873 commit fd691d8

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

ReactCommon/jsi/jsi/test/testlib.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,23 @@ TEST_P(JSITest, HostObjectTest) {
394394
.getBool());
395395
}
396396

397+
TEST_P(JSITest, HostObjectProtoTest) {
398+
class ProtoHostObject : public HostObject {
399+
Value get(Runtime& rt, const PropNameID&) override {
400+
return String::createFromAscii(rt, "phoprop");
401+
}
402+
};
403+
404+
rt.global().setProperty(
405+
rt,
406+
"pho",
407+
Object::createFromHostObject(rt, std::make_shared<ProtoHostObject>()));
408+
409+
EXPECT_EQ(
410+
eval("({__proto__: pho})[Symbol.toPrimitive]").getString(rt).utf8(rt),
411+
"phoprop");
412+
}
413+
397414
TEST_P(JSITest, ArrayTest) {
398415
eval("x = {1:2, '3':4, 5:'six', 'seven':['eight', 'nine']}");
399416

template/metro.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
getTransformOptions: async () => ({
1111
transform: {
1212
experimentalImportSupport: false,
13-
inlineRequires: false,
13+
inlineRequires: true,
1414
},
1515
}),
1616
},

0 commit comments

Comments
 (0)