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

Avoid JS syntax errors when visiting our site from our browser #1362

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

pavpanchekha
Copy link
Collaborator

This PR rewrites the JavaScript files book.js and feedback.js so that they don't raise errors in our own browser. That involved:

  • Rewrite let, for of, and arrow functions into old-school JavaScript
  • Use IIFEs for callbacks in loops, just like we did in the 00s
  • Test for the existence of window, window.addEventListener, and document.addEventListener before using them
  • Only loosely related, but also update the patcher to work in Python 3.13

Copy link
Collaborator

@chrishtr chrishtr left a comment

Choose a reason for hiding this comment

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

I assume you've tested all the browser versions and the website's features?

@pavpanchekha
Copy link
Collaborator Author

Yes

@chrishtr chrishtr merged commit f344e3a into main Dec 12, 2024
1 check passed
@chrishtr chrishtr deleted the python3-support branch December 12, 2024 22:33
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