-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
Privatize JsValue
's internals and expose it through a JsVariant (with immutable reference)
#4080
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4080 +/- ##
==========================================
+ Coverage 47.24% 53.74% +6.50%
==========================================
Files 476 485 +9
Lines 46892 48139 +1247
==========================================
+ Hits 22154 25874 +3720
+ Misses 24738 22265 -2473 ☔ View full report in Codecov by Sentry. |
JsValue
's internals and expose it through a JsVariant (with immutable reference)
Something is still bugged:
|
Yes, I'll move some of these to unit tests to be easier to prevent regressions. |
@raskad I've had to put back converting float to i32 as a float, and better compare with negative zero, but now it passes all tests and all test262 locally. This should be ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me. Nice work!
I had one nit, but its SUPER nitpicky and isn't really blocking merge at all.
Move
JsValue
to being a struct with an internal enumeration. This prevents people from deconstructing or constructing values directly, instead they should rely on helper methods (likeas_*()
) or using theJsVariant
which contains references to the internal value.The direction here is that we will change the interior representation of JsValue in the near future and this new representation will not be compatible with enum deconstruction / pattern matching.
There is no deprecation strategy here; every PR that add usage of
JsValue
as an enum will have a merge conflict or a test error. Every dependents doing the same will break when they update.Fixes #3761.