-
Notifications
You must be signed in to change notification settings - Fork 649
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
Short-hand methods don't have prototype / construct #1371
Comments
Thanks for reporting this! |
This was already fixed in Static Hermes in 00f18c8. |
thanks ^ i found and checked out /~https://github.com/facebook/hermes/tree/static_h then built and ran Hermes, noting
so converted @mhofman's example to i tried |
can 00f18c8 be safely cherry-picked into an older fork of Hermes running RN 71+ built from source? if not, do we need to upgrade to e.g. RN 72/73/74rc first, then build from source and cherry-pick it? or is it more likely e.g. RN 75 to ship with a future bundled Static Hermes tag? (our goal being to run hardened JS on a version of Hermes compliant/standard enough to the JS spec, with mods to SES if really needed to support all engines) |
@leotm the output is an executable file called Please also note that the documentation in the static_h branch isn't up to date (yet), it is just a copy of the main branch. |
@leotm I doubt that it can be cherry picked as is. Hermes has been effectively frozen for an year (except for critical bug fixes and open source PRs). Meanwhile we have been actively working on the static_h branch and have diverged a lot. Static H will be much more spec compliant (among other things) and will be a backwards compatible drop-in replacement for Hermes. We are planning to ship it as a replacement for Hermes as soon as possible (small number of months). Even if it isn't included in RN 0.75, it should be possible to replace Hermes manually. Details of the release are still being worked out. |
noted ^ thanks this helps with our planning, last final thought (i'll mark Off Topic and raise if better as separate issue) testing Hermes outside of RN with eshost recommends esvu/jsvu and obvs hermes-engine-cli-v0.12.0.tgz (afaik ye olde playground version) is old too is there anything i can do to help to get us an updated and/or output a bit more detailed
to determine which commit we're running |
That is a very good question. That version hasn't been updated since we started to bundle Hermes with RN releases years ago. Let me discuss this with the team and I will post back here. |
thank you for v0.13.0! |
any chance publishing it? on/to https://www.npmjs.com/package/hermes-engine-cli (still v0.12.0) cc @fbmal7 |
i've currently integrated if it won't be updated/published there, then will need to revert to fetching the .tar.gz then unpacking it as before |
@leotm we are currently trying to formulate a strategy for publishing new versions of Hermes/Static Hermes, so any ideas/asks/suggestions are very welcome. Can you please describe the needs of your use case? At the moment, our main distribution vehicle is React Native itself - when React Native makes a release, they build and package Hermes and include it in their distribution. This avoids any possible confusion about which Hermes version goes with which RN release. The previous main distribution mechanism - We also plan to continue publishing .tgz distributions, although it is not clear who is using them. I guess they exist for the possibility that we have users outside of React Native. |
ideally a the goal being to keep RN apps secure once there, so running Hardened JS (proposed to ECMA TC39) on Hermes, then running LavaMoat to sandbox deps with Compartments
|
Bug Description
Short hand method in object literals (e.g.
{ foo () {} }
are not constructor functions and as such should not have aprototype
property nor have a[[Construct]]
behavior.A similar issue was fixed last year for arrow functions in c42491d
gradle clean
and confirmed this bug does not occur with JSCHermes git revision (if applicable): c2f7dcd
React Native version: N/A
OS: Linux
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): x86_64
Steps To Reproduce
eshost -s test-has-construct.js
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: