Closed
Bug 608358
Opened 14 years ago
Closed 14 years ago
inspect() and pprint() console helper functions not working on window object
Categories
(DevTools :: General, defect)
DevTools
General
Tracking
(blocking2.0 final+)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: rcampbell, Assigned: rcampbell)
References
Details
Attachments
(2 files)
(deleted),
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review |
Not sure if it's on all pages or not.
1. On this page, open the web console (ctrl/cmd-shift-k)
2. in the command line, enter "inspect(window)"
expect to see a js object inspector open on the window object. Instead, we get"
16:49:57.772: [Exception... "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: resource://gre/modules/PropertyPanel.jsm :: namesAndValuesOf :: line 130" data: no]
Assignee | ||
Comment 1•14 years ago
|
||
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101029 Firefox/4.0b8pre
Assignee | ||
Comment 2•14 years ago
|
||
same test seems to pass for "inspect(document)".
Summary: inspect() and pprint() console helper functions not working, revisit jsterm unittests → inspect() and pprint() console helper functions not working on window object
Assignee | ||
Comment 3•14 years ago
|
||
workaround: inspect(this) returns an inspector on the window object.
Comment 4•14 years ago
|
||
(In reply to comment #3)
> workaround: inspect(this) returns an inspector on the window object.
Yeah - this is an xrayWrapped *window* that does this. The patch is a one liner that unwraps any object passed into that function "namesAndValuesOf"
Assignee | ||
Comment 5•14 years ago
|
||
yeah, you're right. I just added a little test inside pprint() and it's returning a wrapped window object. Even though running "typeof(window)" on the console returns "object".
Trying to understand why this is, I guess object evaluated inside the sandbox are wrapped, but results coming back from it are unwrapped.
nifty!
Assignee | ||
Comment 6•14 years ago
|
||
adding in a few unwraps and an unwrap() convenience method.
Assignee: nobody → rcampbell
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•14 years ago
|
||
requesting blocking final so we can get this reviewed and landed.
blocking2.0: --- → ?
Assignee | ||
Updated•14 years ago
|
Attachment #487168 -
Flags: review?(gavin.sharp)
Comment 8•14 years ago
|
||
Blocking, seems like a common thing to be inspected.
blocking2.0: ? → final+
Comment 9•14 years ago
|
||
Comment on attachment 487168 [details] [diff] [review]
[checked-in] unwrap
This should be easy to test, right?
Attachment #487168 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 10•14 years ago
|
||
(In reply to comment #9)
> Comment on attachment 487168 [details] [diff] [review]
> unwrap
>
> This should be easy to test, right?
trivially. I'll add a couple to the JSTerm helper tests.
Assignee | ||
Comment 11•14 years ago
|
||
simple tests for pprint(window) and keys(window)
Assignee | ||
Comment 12•14 years ago
|
||
Comment on attachment 487168 [details] [diff] [review]
[checked-in] unwrap
http://hg.mozilla.org/mozilla-central/rev/f9966f6545e0
Attachment #487168 -
Attachment description: unwrap → [checked-in] unwrap
Assignee | ||
Updated•14 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•