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
What went wrong in the code? What is the system trying to tell you?
That z.a.b.c is undefined, so you can't access the d property on it
What error message do you see? Which JavaScript environment produced this error?
#### jsc
TypeError: undefined is not an object (evaluating 'z.a.b.c.d')
#### V8
TypeError: Cannot read property 'd' of undefined
#### chakracore
TypeError: Unable to get property 'd' of undefined or null reference
#### spidermonkey
TypeError: z.a.b.c is undefined
eshost shows that only SpiderMonkey gives helpful output
What error message would you like to see?
SpiderMonkey-style output in all JS engines
Do you agree to license your suggested error message under an MIT-style license?
This code, which forgets to return this from the add method, gives you the following error:
TypeError: Cannot read property 'add' of undefined
I really like the Elm style pointers that tell you exactly there something is undefined, but in this case, when a method is returning undefined, it would be nice to be even more explicit and say something like The add() method of cal is returning undefined.
I know that's probably a long shot, but A GIRL CAN DREAM.
I feel like the spidermonkey message is incomplete. I read that 4 times before I realized it was only talking about 'c' instead of 'd'. While it's correctly identifying the root problem, it doesn't mention the symptom at all and that seems surprising.
I suggest:
"TypeError: z.a.b.c.d could not be evaluated because z.a.b.c is undefined."
Activity
codehag commentedon Oct 17, 2018
Playing around with elm style errors again.. just to see what they might look like:
brittanydionigi commentedon Oct 18, 2018
Another example related to this...
This code, which forgets to return
thisfrom theaddmethod, gives you the following error:TypeError: Cannot read property 'add' of undefinedI really like the Elm style pointers that tell you exactly there something is undefined, but in this case, when a method is returning undefined, it would be nice to be even more explicit and say something like
The add() method of cal is returning undefined.I know that's probably a long shot, but A GIRL CAN DREAM.
getify commentedon Oct 31, 2018
I feel like the spidermonkey message is incomplete. I read that 4 times before I realized it was only talking about 'c' instead of 'd'. While it's correctly identifying the root problem, it doesn't mention the symptom at all and that seems surprising.
I suggest:
"TypeError: z.a.b.c.d could not be evaluated because z.a.b.c is undefined."