-
Notifications
You must be signed in to change notification settings - Fork 310
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
Feature problem: yieldEach #453
Comments
Thanks for filing this, and sure, please send a PR! I think the right approach though would be to try and obtain a random variable of type |
Thanks for your feedback! I agree with getting a random variable of type
Thnaks again! |
The HowFuzzilliWorks Doc touches on that a bit (but it should be more detailed...). One reason is that our type analysis is very basic, so for a lot of the variables we don't know their type. If we were very conservative with our code generation (e.g. what you describe, use only input variables of known-correct types and otherwise generate new code), then there would be many variables in the program that we would never use in certain ways (because we don't know their types). On the other hand, we'd generate a lot of code like The other thing is that value generation is very biased in the sense that if you do value generation for a .iterable, you will probably always emit an ArrayLiteral. However, there are many other ways of generating a .iterable. Our CodeGenerators take care of emitting such code, but then we still need to use those variables later on, and so we should prefer to use existing variables rather than generating new ones. Does that make sense and answer your question? |
Thank you for your detailed explanation! Your insights on type analysis and code generation are very helpful! I will further improve the code based on the direction you mentioned and submit a PR about the issue. Thank you again for your help! |
Problem
By JS definition MDN , what is passed to
yieldeach
must be an iterable object.YieldGenerator
,GeneratorFunctionGenerator
,AsyncGeneratorFunctionGenerator
useb.yieldEach(b.randomVariable())
,where
randomVariable
is likely to be a non-iteratable object such as an integer.Q:
I believe I might be able to fix this issue by
buildIteratorVariable
method that can generate some iterable objects. Would it be alright if I submitted a pull request to address this?The text was updated successfully, but these errors were encountered: