Skip to content

Avoid eval in date-format-tofte #62

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

camillobruni
Copy link
Contributor

Eval has become less and less popular and is actively prohibited by headers on many domains.
date-format-tofte uses an eval that can be easily replaced with a object lookup.

@camillobruni camillobruni changed the title Avoid eval in date-formate-tofte Avoid eval in date-format-tofte Mar 26, 2025
Copy link

netlify bot commented Mar 26, 2025

Deploy Preview for webkit-jetstream-preview ready!

Name Link
🔨 Latest commit d280391
🔍 Latest deploy log https://app.netlify.com/sites/webkit-jetstream-preview/deploys/67e404614134ff00084f18b7
😎 Deploy Preview https://deploy-preview-62--webkit-jetstream-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 26, 2025

Deploy Preview for webkit-jetstream-preview ready!

Name Link
🔨 Latest commit fa7ae85
🔍 Latest deploy log https://app.netlify.com/sites/webkit-jetstream-preview/deploys/67e4046cbf9b7600087e8990
😎 Deploy Preview https://deploy-preview-62--webkit-jetstream-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@iainireland iainireland left a comment

Choose a reason for hiding this comment

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

LGTM! I was going to bring this eval up in the next meeting; glad to see it disappear.

@camillobruni
Copy link
Contributor Author

There are likely a bunch of other places... but this one was trivial to replace.

@iainireland
Copy link

The other place where we've seen eval as a hotspot is in multi-inspector-code-load, which measures how well you can cache indirect eval. I hate that one less, since an eval cache has non-zero value in the real world.

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.

2 participants