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
Make expr_simplifier
handle expressions when indexing strings, arrays and objects
#8750
base: main
Are you sure you want to change the base?
Conversation
|
Not totally sure if the changed code for array literals is correct -- the code for this is a little more complicated than strings.
|
Another broken test case: var _ = {0.5: 'test'}[0.5]; Currently simplifies to: var _ = {
0.5: 'test'
}[0.5]; Should simplify to: var _ = 'test'; Not entirely sure if this is correct though because removing the |
Only one potential issue so far, that |
expr_simplifier
return undefined
when indexing out of boundsexpr_simplifier
handle expressions when indexing strings, arrays and objects
@kdy1 The only remaining issue in terms of code changes is this line. Currently fold("({0.5: 'a'})['0.5']", "'a';"); |
I'm pretty sure |
I have ran |
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.
CI failed
To do:
Will comment here again when everything is finalised |
Is there a reason why stuff like |
|
|
Does this apply to objects too? Like should |
Need to handle known object properties in simplify's |
I don't think so. |
Description:
This PR is a WIP that fixes all known issues in #8747.
BREAKING CHANGE:
Related issue (if exists):
Closes #8747