I have js warnings switched on so I can get some sort of confidence that my extension isn't doing something wacky. Though pretty much the only stuff I'm getting is some trace I've added while I refactor part of it.
But this sort of thing depresses me:
SyntaxError: test for equality (==) mistyped as assignment (=)? 0W-sSTssQ2I.js:10:2191
SyntaxError: 'use strict' statement won't be enforced as a directive because it isn't in directive prologue position 0W-sSTssQ2I.js:18:729
SyntaxError: 'use strict' statement won't be enforced as a directive because it isn't in directive prologue position 3fvKUm1gRWA.js:10:456
SyntaxError: 'use strict' statement won't be enforced as a directive because it isn't in directive prologue position 3fvKUm1gRWA.js:11:233
TypeError: useless expression 3MxwccAAarv.js:3:2587
ReferenceError: reference to undefined property this.$Dispatcher_DEPRECATED1[m] NQ0NO8kcQHe.js:3:1850
ReferenceError: reference to undefined property M.$$typeof A2RCaiQ_wsN.js:38:2175
TypeError: "name" is read-only
and that's just an excerpt of the piles of junk I can get when I load a web page.
I mean 'use strict' not being enforced. The coder couldn't even get that right?
There are days when I wonder why the web works at all.
Why do I bother trying to write correct javascript
-
- Lunatic
- Posts: 395
- Joined: 2014-05-10, 18:19
- Location: UK
-
- Pale Moon guru
- Posts: 35650
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: Why do I bother trying to write correct javascript
And if you look at the actual names of the files you can see this junk is generated -- so most likely part of some broken framework that's only tested against Chrome. The site owners using it probably don't even know what a browser console is.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Lunatic
- Posts: 395
- Joined: 2014-05-10, 18:19
- Location: UK
Re: Why do I bother trying to write correct javascript
Well, one of the libraries that produces these sorts of messages is jquery
I get quite a log of the undefined property and test for equality mistyped messages when using this website
I get quite a log of the undefined property and test for equality mistyped messages when using this website
-
- Pale Moon guru
- Posts: 35650
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: Why do I bother trying to write correct javascript
It's not your task to troubleshoot that website, is it?
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Lunatic
- Posts: 395
- Joined: 2014-05-10, 18:19
- Location: UK
Re: Why do I bother trying to write correct javascript
Didn't suggest it was. However, it's occasionally quite hard to spot warnings caused by my code in the spew of warnings from websites. Especially at startup.
It is an annoyance I can get round but it is definitely an annoyance.
It is an annoyance I can get round but it is definitely an annoyance.
Re: Why do I bother trying to write correct javascript
You know the technical details better than I, but thinking big picture, this is a good reminder of the long history of browsers being very accomodating of crappy code. The web wouldn't have grown by leaps and bounds 20 years ago without it. And the fact that the various methods of accomodating crappy markup, scripting, etc. have been to a large extent codefied as WHATWG standards is quite interesting.thosrtanner wrote:There are days when I wonder why the web works at all.
And think about it from the webdev perspective. If the crap you write "just works" in Chrome, like Moonchild said, then "ship it". Especially if they don't care one bit about quality of craftmanship, just quick&dirty results.
Re: Why do I bother trying to write correct javascript
Pretty trivial to encourage web developers to understand javascript better, disable just in time compilation for non compliant code, similar to Google's solution of calling everything "not secure" that isn't compliant with their vision of HTTPS for everything.
It'd be a pretty big stick, developers would have to write proper javascript for performance. Would only work if Google decided it would be so though...
It'd be a pretty big stick, developers would have to write proper javascript for performance. Would only work if Google decided it would be so though...