You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On https://janet-lang.org/ repl.js defines methods in the global scope. In particular print() which ends up overriding window.print(). This probably wont break printing the page in browsers because they wouldn't use the JS API but it might break peoples custom scripts and is not good practice. Everything should be wrapped in an IIFE and anything you need accessable on window from elsewhere should be put there explicitly.
The text was updated successfully, but these errors were encountered:
It doesn't really matter in this case. JavaScript "good practice" is for writing packages and large, JavaScript heavy websites. If a custom scripts break with unexpected globals, you need to fix your scripts. It's an easy enough fix though.
On https://janet-lang.org/ repl.js defines methods in the global scope. In particular
print()
which ends up overridingwindow.print()
. This probably wont break printing the page in browsers because they wouldn't use the JS API but it might break peoples custom scripts and is not good practice. Everything should be wrapped in an IIFE and anything you need accessable onwindow
from elsewhere should be put there explicitly.The text was updated successfully, but these errors were encountered: