Skip to content

[codemod] Remove use of eval()#48701

Open
oliviertassinari wants to merge 1 commit into
mui:masterfrom
oliviertassinari:remove-use-of-eval
Open

[codemod] Remove use of eval()#48701
oliviertassinari wants to merge 1 commit into
mui:masterfrom
oliviertassinari:remove-use-of-eval

Conversation

@oliviertassinari

@oliviertassinari oliviertassinari commented Jun 20, 2026

Copy link
Copy Markdown
Member

The eval() was not required since we do a j.BinaryExpression.check( https://astexplorer.net/#/gist/afd7a9826b74db48e14cfa176a8f113f/7c6e9cc95649922afdf546aef7238d947f70af74 so we can remove it.

Now, this codemod logic is 7 years old; it was added in #15782, it's never run anymore, but having an eval() raises questions: https://groups.google.com/a/mui.com/g/security/c/SpAXHq8xkAM. So we might as well remove it.

@oliviertassinari oliviertassinari added package: codemod Specific to codemod. security Pull requests that address a security vulnerability. labels Jun 20, 2026
@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-48701--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@Janpot Janpot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggestion: deduplicate

const apply = (operator, value) => ...

// ...

  param = j.literal(apply(operator, value));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: codemod Specific to codemod. security Pull requests that address a security vulnerability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants