News for hackers. Stuff that matters.
Re:Math.Round opens the browser print dialog by exogen on Wednesday June 19, 2019 @08:50PM (#20228806)
So it's caused by a reference to `print` not being what they expected.

The create-react-app project maintains a great list of "confusing browser globals" for exactly this situation! https://github.com/facebook/create-react-app/tree/master/pac...

You can use it along with ESLint to detect situations where a variable reference is technically valid (it will refer to the window property) but is probably not what you're intending.

Some of them are really easy to trip over, like `error`, `name`, and `open`. All global properties on the window!

Re:Math.Round opens the browser print dialog by habosa on Thursday June 20, 2019 @12:12AM (#20229797)
Name got me the other day. I was writing typescript and not even targeting the browser but I guess I had browser globals in the .d.ts

I had a string like "Hello ${name}" and it would compile but crash at runtime.

Wasted a whole day, learned a lot about why even with great tools the JS ecosystem still has some fundamental crap at the bottom.