Closed
Bug 1255734
Opened 8 years ago
Closed 8 years ago
DevTools: Inspecting a primitive value in console throws a TypeError
Categories
(DevTools :: Object Inspector, defect, P1)
Tracking
(firefox48 fixed)
RESOLVED
FIXED
Firefox 48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: jsnajdr, Assigned: jsnajdr)
Details
(Whiteboard: [btpp-fix-now])
Attachments
(1 file)
4.49 KB,
patch
|
vporof
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0 Build ID: 20160225030209 Steps to reproduce: 1. Open devtools console. 2. Type 'inspect(1)' - to inspect a primitive value Actual results: If you have a browser toolbox console open, you can see a TypeError reported: TypeError: invalid 'in' operand aGrip This happens in the VariableViewController._populateFromObject, where there is a statement: if ("ownPropertyLength" in aGrip) aGrip is not an object, but it's the primitive number value 1. Expected results: No errors.
Assignee | ||
Comment 1•8 years ago
|
||
Adding a patch: - in VariablesViewController.setSingleVariable, call this.populate only if the object is not primitive. Otherwise, just return a resolved promise. - I renamed the parameters of the setSingleVariable method to remove the Hungarian notation and make ESLint happy. - added a new test case to browser_jsterm_inspect.js. Without the fix, the test times out (the "variablesview-updated" event is never fired). - slightly refactored the test to use the "variablesview-updated" event instead of "fetched". It works consistently for both primitive and non-primitive values (the "variablesview-fetched" event is fired only when "populate" is called).
Attachment #8729433 -
Flags: review?(vporof)
Assignee | ||
Comment 2•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=868482a1c16b
Updated•8 years ago
|
Assignee: nobody → jsnajdr
Status: UNCONFIRMED → ASSIGNED
Component: Developer Tools: Console → Developer Tools: Object Inspector
Ever confirmed: true
Updated•8 years ago
|
Priority: -- → P1
Whiteboard: [btpp-fix-now]
Comment 3•8 years ago
|
||
Comment on attachment 8729433 [details] [diff] [review] DevTools: Inspecting a primitive value in console throws a TypeError Review of attachment 8729433 [details] [diff] [review]: ----------------------------------------------------------------- Nice!
Attachment #8729433 -
Flags: review?(vporof) → review+
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 5•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/282de7d09bce
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•