Skip to content

Commit

Permalink
Re-sync with internal (#29778)
Browse files Browse the repository at this point in the history
fbshipit-source-id: 65e2766a6a097eca0e0d0fda8dadf6871e9276c2
  • Loading branch information
bigfootjon authored Aug 26, 2020
1 parent 1270873 commit fd691d8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions ReactCommon/jsi/jsi/test/testlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,23 @@ TEST_P(JSITest, HostObjectTest) {
.getBool());
}

TEST_P(JSITest, HostObjectProtoTest) {
class ProtoHostObject : public HostObject {
Value get(Runtime& rt, const PropNameID&) override {
return String::createFromAscii(rt, "phoprop");
}
};

rt.global().setProperty(
rt,
"pho",
Object::createFromHostObject(rt, std::make_shared<ProtoHostObject>()));

EXPECT_EQ(
eval("({__proto__: pho})[Symbol.toPrimitive]").getString(rt).utf8(rt),
"phoprop");
}

TEST_P(JSITest, ArrayTest) {
eval("x = {1:2, '3':4, 5:'six', 'seven':['eight', 'nine']}");

Expand Down
2 changes: 1 addition & 1 deletion template/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
inlineRequires: true,

This comment has been minimized.

Copy link
@elicwhite

elicwhite Aug 26, 2020

Member

This is from @GantMan in #29770

},
}),
},
Expand Down

0 comments on commit fd691d8

Please sign in to comment.