Reps with a more link sometimes show "-N more"

RESOLVED FIXED in Firefox 52

Status

P2
normal
RESOLVED FIXED
2 years ago
2 months ago

People

(Reporter: linclark, Assigned: nchevobbe)

Tracking

unspecified
Firefox 52

Firefox Tracking Flags

(firefox52 fixed)

Details

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(2 attachments)

(Reporter)

Description

2 years ago
Created attachment 8795697 [details]
Firefox_Developer_Edition_Start_Page.png

The more link sometimes shows a negative number. See picture for an example.
(Reporter)

Updated

2 years ago
Priority: -- → P2
(Assignee)

Updated

2 years ago
Assignee: nobody → chevobbe.nicolas
(Assignee)

Comment 1

2 years ago
The problem is that we are checking the computed props against `object.ownPropertyLength` to see if there's more to show.
But, if an object has a non-enumerable property (in the attachment from comment 0, it is probably `prototype`), `ownPropertyLength` counts it, but it does not appear `object.preview`.

So we have 0 computed properties, but ownPropertyLength to 1, and it gives us 
> `${object.ownPropertyLength - max} more...`
> `${1 - 3} more...`
> `-2 more...`

FYI , in the current console (not using Reps) , there's a bug too, since it displays :

> Object { , n more… }

Where 'n' is the number of non-enumerable properties in the object.


The simplest way of fixing this is to check the computed properties length, and not ownPropertyLength.
Comment hidden (mozreview-request)

Comment 4

2 years ago
mozreview-review
Comment on attachment 8798369 [details]
Bug 1305981 - Fix grip truncation on object with non-enumerable properties. ;

https://reviewboard.mozilla.org/r/83834/#review83182

LGTM!

Honza
Attachment #8798369 - Flags: review?(odvarko) → review+

Comment 5

2 years ago
Pushed by chevobbe.nicolas@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/c65749eee4dc
Fix grip truncation on object with non-enumerable properties. r=Honza;

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c65749eee4dc
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox52: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52

Updated

2 years ago
Depends on: 1320399

Updated

2 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.