Skip to content
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

fix JS optimizer fail on ES6 spread operator #18461

Merged
merged 3 commits into from
Jan 5, 2023

Conversation

pavelsavara
Copy link
Contributor

fixes #12543

@sbc100
Copy link
Collaborator

sbc100 commented Jan 4, 2023

Would be good to add a test somewhere. @kripken probably knows where the best place might be

@pavelsavara pavelsavara marked this pull request as ready for review January 4, 2023 07:40
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pavelsavara
Copy link
Contributor Author

I don't have the tests running on my local box, so I will make test iterations on the CI. Sorry for the noise.

@kripken
Copy link
Member

kripken commented Jan 4, 2023

Running locally, this is the diff from --rebaseline:

diff --git a/test/optimizer/JSDCE-output.js b/test/optimizer/JSDCE-output.js
index 89c4957f7..480f0396b 100644
--- a/test/optimizer/JSDCE-output.js
+++ b/test/optimizer/JSDCE-output.js
@@ -14,6 +14,19 @@ function g(a) {
 
 Module["g"] = g;
 
+const sx = {
+ a: 1
+};
+
+const sar = [ 1, 2, 3 ];
+
+Module["spread"] = {
+ b: 2,
+ ...sx
+};
+
+Module["spread2"] = [ ...sar, 4, 5, 6 ];
+
 function h(a) {
  return a + 1;
 }

@kripken
Copy link
Member

kripken commented Jan 5, 2023

Committed, should pass I hope...

@kripken kripken enabled auto-merge (squash) January 5, 2023 00:02
@kripken kripken merged commit de13451 into emscripten-core:main Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Acorn optimizer - Cannot read property 'type' of undefined
3 participants