Undefined values aren't properly displayed in the debugger's variables view

RESOLVED FIXED in Firefox 24

Status

defect
P2
normal
RESOLVED FIXED
6 years ago
Last year

People

(Reporter: vporof, Assigned: vporof)

Tracking

unspecified
Firefox 24
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

STR:

1. Open debugger on http://htmlpad.org/debugger/
2. Click me
3. Expand the |b| variable
or
  Scroll down to inspect the undefined member of the window scope
or
  Add a "undefined" (without quotes" watch expreesion

No value is displayed for undefined variables :(
Assignee: nobody → vporof
Status: NEW → ASSIGNED
Priority: -- → P2
Posted patch v1 (obsolete) — Splinter Review
Attachment #762884 - Flags: review?(past)
Comment on attachment 762884 [details] [diff] [review]
v1

Review of attachment 762884 [details] [diff] [review]:
-----------------------------------------------------------------

This is actually a server bug. The protocol specifies how undefined values should be transferred, but I must have botched it:

https://wiki.mozilla.org/Remote_Debugging_Protocol#Grips

In this case the server's response for a prototypeAndProperties request on object "b" is:

{
  "from": "conn0.obj50",
  "prototype": {
    "type": "object",
    "class": "Object",
    "actor": "conn0.obj62",
    "extensible": true,
    "frozen": false,
    "sealed": false
  },
  "ownProperties": {
    "a": {
      "configurable": true,
      "enumerable": true,
      "writable": true,
      "value": 1
    },
    "xxx": {
      "configurable": true,
      "enumerable": true
    }
  },
  "safeGetterValues": {}
}

I bet all of our unit tests for undefined values deal with arguments, not variable properties, otherwise we should have caught this long ago. Are you going to look into this or do you want me to?
Attachment #762884 - Flags: review?(past) → review-
(In reply to Panos Astithas [:past] from comment #2)

> I bet all of our unit tests for undefined values deal with arguments, not
> variable properties, otherwise we should have caught this long ago.

Yup, that's why I added some more tests in this patch.

> Are you going to look into this or do you want me to?

Don't worry about it, I'll take a look.
(In reply to Victor Porof [:vp] from comment #3)
> (In reply to Panos Astithas [:past] from comment #2)
> 
> > I bet all of our unit tests for undefined values deal with arguments, not
> > variable properties, otherwise we should have caught this long ago.

Variables themselves (direct members of a scope) seem to be ok as well, so this happens only for properties.
Posted patch v1Splinter Review
Well.. this was pretty obvious.
Attachment #762884 - Attachment is obsolete: true
Attachment #763546 - Flags: review?(past)
Comment on attachment 763546 [details] [diff] [review]
v1

Review of attachment 763546 [details] [diff] [review]:
-----------------------------------------------------------------

I'm... sorry!

::: toolkit/devtools/server/tests/unit/test_framebindings-01.js
@@ +56,5 @@
> +      do_check_eq(aResponse.ownProperties.b.configurable, true);
> +      do_check_eq(aResponse.ownProperties.b.enumerable, true);
> +      do_check_eq(aResponse.ownProperties.b.writable, true);
> +      do_check_eq(aResponse.ownProperties.b.value.type, "undefined");
> +      do_check_true(!("class" in aResponse.ownProperties.b.value));

do_check_false would be better here.
Attachment #763546 - Flags: review?(past) → review+
Posted patch v1.1Splinter Review
Now using do_check_false.
Attachment #763558 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/6d680ab84fbd
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 24
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.