-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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 transform of unary expression in Babel plugin #17596
Conversation
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.
To (easily) fix the linting errors locally, you can run gulp lint --fix
.
Please add tests in this file, e.g. as follows, since the lack of testing is what "caused" the regression.
var k = !PDFJSDev.test('TRUE');
var l = !PDFJSDev.test('FALSE');
All of our static evaluation & dead-code elimination transforms need to happen in post-order, transforming inner nodes first. This is so that in complex nested cases all transforms see the simplified version of their inner nodes. For example: async getNimbusExperimentData() { if (!PDFJSDev.test("GECKOVIEW")) { return null; } // other code } -> [evaluation of PDFJSDev.*] async getNimbusExperimentData() { if (!false) { return null; } // other code } -> [!false -> true] async getNimbusExperimentData() { if (true) { return null; } // other code } -> [if (true) -> replace with the if branch] async getNimbusExperimentData() { return null; // other code } -> [early return -> remove dead code] async getNimbusExperimentData() { return null; // other code } This was done correctly in all cases except for our `UnaryExpression` transform, which was happening in pre-order.
59dd6f7
to
a352f28
Compare
Done! |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/fc9fee8528a7fd2/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/c801288436756a0/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/fc9fee8528a7fd2/output.txt Total script time: 24.82 mins
Image differences available at: http://54.241.84.105:8877/fc9fee8528a7fd2/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/c801288436756a0/output.txt Total script time: 39.71 mins
Image differences available at: http://54.193.163.58:8877/c801288436756a0/reftest-analyzer.html#web=eq.log |
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.
r=me, thank you for the patch!
The generated code in
build/.../viewer.js
is nowand the generated code in
build/.../viewer-geckoview.js
isFixes #17589