Closed Bug 831724 Opened 11 years ago Closed 11 years ago

Variables View: [object undefined] for Window when inspecting raw objects

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: msucan, Assigned: vporof)

References

Details

Attachments

(1 file)

If you try to inspect the Window object with the Variables View, using the rawObject approach, you get [object undefined] for the window property, for |self| and for other objects.

It seems vview does not correctly determine the class for some objects.

After a bit of investigation I saw the problem is in getGrip(). You might want to use WebConsoleUtils.getObjectClassName() to determine the class name - this is something reusable from the Web Console property panel. If you use that for the |class| grip property, things should be fine.
(In reply to Mihai Sucan [:msucan] from comment #0)
> 
> After a bit of investigation I saw the problem is in getGrip(). You might
> want to use WebConsoleUtils.getObjectClassName() to determine the class name
> - this is something reusable from the Web Console property panel. If you use
> that for the |class| grip property, things should be fine.

Excellent, thanks for digging this up!
Assignee: nobody → vporof
Status: NEW → ASSIGNED
Priority: -- → P2
Attached patch v1Splinter Review
Simply using getObjectClassName made the test fail, because it expected class names to start with an uppercase letter.

Mihai, something unrelated to this patch: REGEX_MATCH_FUNCTION_NAME doesn't seem to match neither
> function() {}
nor
> function () {}
Attachment #703817 - Flags: review?(mihai.sucan)
Comment on attachment 703817 [details] [diff] [review]
v1

Patch looks good. Also tested it with my patches for bugs 783499 and 808370.

Please test that the WCU change doesn't break existing web console tests, otherwise r+.
Attachment #703817 - Flags: review?(mihai.sucan) → review+
(In reply to Mihai Sucan [:msucan] from comment #3)
> Comment on attachment 703817 [details] [diff] [review]
> v1
> 
> Patch looks good. Also tested it with my patches for bugs 783499 and 808370.
> 
> Please test that the WCU change doesn't break existing web console tests,
> otherwise r+.

Already did, everything seems fine.
Thanks!
Victor, thanks for your patch!

(In reply to Victor Porof [:vp] from comment #2)
> Mihai, something unrelated to this patch: REGEX_MATCH_FUNCTION_NAME doesn't
> seem to match neither
> > function() {}
> nor
> > function () {}

The regex comment is confusing in WCU.jsm. The purpose of the regex is to match/find the function name, even if it doesn't have a name. In the case when it doesn't have a name, it doesn't match anything (no name = nothing to match). Those examples are meant to show what I tested against.

Since you modify WCU, maybe you can make the comment less confusing? Thanks!
Somehow this made a webconsole test unhappy (test_object_actor.html). I don't understand why I didn't catch this previously. Fixed: https://hg.mozilla.org/integration/fx-team/rev/1bc9ef10c261
https://hg.mozilla.org/mozilla-central/rev/c201b9d74699
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 21
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: