New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 763713 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue v8:6513
Owner:
Last visit > 30 days ago
Closed: Sep 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Feature



Sign in to add a comment

Unhelpful error: "Cannot set property '1' of undefined" - please say what name it is that's undefined.

Reported by richard....@unipart.com, Sep 10 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/60.0.3112.113 Chrome/60.0.3112.113 Safari/537.36

Steps to reproduce the problem:
var test = [1,2,3];
test[1] = 2;

var test2;
test2[1] = 22;

What is the expected behavior?
The first pair of lines are correct; the second will fail.
However, the error message is rather less clear than it could be. 

What went wrong?
I get the error message: "Cannot set property '1' of undefined".  

That's not as helpful as it could be, because Chrome has already de-referenced the thing that's not defined.

What would be far better is the error:
 "Cannot set property '1' of 'test2' which is undefined.

In other words, what I want to know is "there is a problem with test2, caused by it being undefined", not "there is a problem with something undefined... now you go figure out what it was that wasn't defined".

This doesn't just affect arrays.

Did this work before? No 

Chrome version: 60.0.3112.113  Channel: n/a
OS Version: Ubuntu
Flash Version:
 

Comment 1 by woxxom@gmail.com, Sep 10 2017

Sounds like a good idea to implement along with other error messages already tracked in https://bugs.chromium.org/p/v8/issues/detail?id=6513
Labels: -Type-Bug Type-Feature
Status: Untriaged (was: Unconfirmed)
Assuming this as feature request, changing the status to untriage, so that the issue would be addressed.


Thank you.
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Untriaged)
@kozy, maybe merge this to the v8 bug linked above?
Mergedinto: v8:6513
Status: Duplicate (was: Assigned)

Sign in to add a comment