-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
SourceText
collection & toString()
for fns and methods
#4038
base: main
Are you sure you want to change the base?
Conversation
TODO: find out is `derive(arbitrary::Arbitrary)` in `core\ast\src\source.rs::Script` correct?
TODO: also find out correctness of `derive(arbitrary::Arbitrary)` for `LinearSpan`, `LinearPosition`
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4038 +/- ##
==========================================
+ Coverage 47.24% 53.68% +6.43%
==========================================
Files 476 485 +9
Lines 46892 47270 +378
==========================================
+ Hits 22154 25376 +3222
+ Misses 24738 21894 -2844 ☔ View full report in Codecov by Sentry. |
I have not done an in depth review yet, just an initial question. As far as I see, the positions you used for the function start and end ( I think that would not work in cases where other stuff is in the same line, e.g.: let a = 1; function f() {return a + 1}; let b = 3; In this case |
@raskad in details:
here is tests
|
also you can read the issue where it was accepted to collect the source code(it should slow down parse stage performance) |
This Pull Request closes #3780
In current approach all
SourceText
collected (because mostly a script consist of function codes and classes) andLinearSpan
used to retrieve it when needed (to be fairtoString()
not often called);Gc::<SourceText>
used for storage and therefore it can be deallocated only when we have access to no function from a source anymore.It actually solve some tests from
test262
, but there is implementation for checkingtoString()
correctness that take any[native code]
as correct, without regard to whether it should accept in concrete case or not (assertToStringOrNativeFunction
).Also I don't sure about
derive(arbitrary::Arbitrary)
forcore\ast\src\source.rs::Script
&LinearSpan
, just derive is ok here?