Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove upcasting test in BridgingTest.cpp #37519

Closed
wants to merge 1 commit into from

Conversation

neildhar
Copy link
Contributor

Summary:
While these tests currently happen to pass, actually trying to
instantiate fromJs fails to compile. I suspect this is attributable
to some difference in how fromJs is instantiated in evaluated and
unevaluated contexts. That is since supportsFromJs only instantiates
it in an unevaluated context (in a decltype), the rules are presumably
different.

It is also worth noting that the operator of up-casting JSI types to
jsi::Value is explicitly deleted in Converter, which suggests
that the conversion this test is checking for may be intentionally
unsupported.

For now, since fromJs cannot actually be used with the given
parameters, delete the test.
This unblocks a later diff which changes the constructor of
jsi::Value such that
std::is_convertible<jsi::Object &, jsi::Value> is no longer true (the
conversion is never allowed, but is currently enforced by
static_assert ). With that change
supportsFromJs<jsi::Value, jsi::Object> also becomes false.

Reviewed By: javache, cortinico

Differential Revision: D46059603

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels May 22, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46059603

@analysis-bot
Copy link

analysis-bot commented May 22, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,733,371 +0
android hermes armeabi-v7a 8,044,556 +1
android hermes x86 9,223,479 +0
android hermes x86_64 9,075,461 +1
android jsc arm64-v8a 9,298,177 -1
android jsc armeabi-v7a 8,486,913 -1
android jsc x86 9,359,350 +3
android jsc x86_64 9,615,429 +3

Base commit: c396bc7
Branch: main

Summary:
Pull Request resolved: facebook#37519

While these tests currently happen to pass, actually trying to
instantiate `fromJs` fails to compile. I suspect this is attributable
to some difference in how `fromJs` is instantiated in evaluated and
unevaluated contexts. That is since `supportsFromJs` only instantiates
it in an unevaluated context (in a decltype), the rules are presumably
different.

It is also worth noting that the operator of up-casting JSI types to
`jsi::Value` is explicitly deleted in `Converter`, which suggests
that the conversion this test is checking for may be intentionally
unsupported.

For now, since `fromJs` cannot actually be used with the given
parameters, delete the test.
This unblocks a later diff which changes the constructor of
`jsi::Value` such that
`std::is_convertible<jsi::Object &, jsi::Value>` is no longer true (the
conversion is never allowed, but is currently enforced by
`static_assert` ). With that change
`supportsFromJs<jsi::Value, jsi::Object>` also becomes false.

Changelog: [Internal]

Reviewed By: javache, cortinico

Differential Revision: D46059603

fbshipit-source-id: a10c0aec36288c509b07b4473c66e4f8688e1c75
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46059603

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label May 22, 2023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 11e80b6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants