Closed Bug 629913 Opened 14 years ago Closed 12 years ago

Web Console inspect Update causes changes when no state has changed

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: bj, Unassigned)

Details

(Whiteboard: [console-2])

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b11pre) Gecko/20110129 Firefox/4.0b11pre Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b11pre) Gecko/20110129 Firefox/4.0b11pre If you open an inspect window from the web console and click Update, there should be no change in the display unless the object being inspected has changed. In some cases Firefox doesn't follow dictum and Update causes changes. I don't know whether the original display or the post-Update display is appropriate, it depends what the intent is of the inspect window. Reproducible: Always Steps to Reproduce: 1. Create a file containing "<script>var o=new Object(); o.a=1;</script>". 2. Open the file in Firefox 4/pre10. 3. Open the web console. 4. Type "o" to the web console. 5. Modify the file to contain "<script>var o=new Object(); o.a=1; o.b=2; </script>". 6. Reload the file. 7. Type "o" to the web console. At this point the web console output should be: o ({a:1}) o ({a:1, b:2}) 8. Click on the "({a:1})". An inspect window shows "a:1". 9. Click Update on the inspect window. Actual Results: The contents of the inspect window changes to show "a:1" and "b:2:". Expected Results: The Update should not change the contents of the inspect window since no variables have changed since the window was opened.
Build ID: Mozilla/5.0 (Windows NT 6.1; rv:2.0b12pre) Gecko/20110207 Firefox/4.0b12pre It is normal for the inspector to update with b:2 because on reload, meaning step 6, you have added a new instance of the "o" Object. The inspector senses this by reading the source file and echoes your modifications by "Update" button. From my understanding this is perfectly normal. Mihai, David, anyone? I have added BJ's STR in a simple testcase.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
I think this is a valid concern/report. The behavior is unexpected. It needs further investigation. I can only confirm it is unexpected. Having clicked the first "o" evaluation result I would expect to either see the up-to-date content of "o" (after reload), or I'd like to see the previous content of "o" (as it happens now). In both cases, when I click Update I don't expect changes. There's definitely a bug somewhere.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Component: General → Developer Tools
OS: Linux → All
QA Contact: general → developer.tools
Hardware: x86_64 → All
Version: unspecified → Trunk
In that case, what is the actual behavior for the Update feature in the inspector? It's unclear to me at the moment
This happens because the Update button re-evaluates user's input. So if you evaluated "o", then Update will re-evaluate "o", and you get to see the new content of "o". This is confusing behavior, but technically it is correct. Not sure what we should do about this. Any thoughts David?
(In reply to comment #5) > So if you evaluated "o", then Update will re-evaluate "o", and you get to see > the new content of "o". This is confusing behavior, but technically it is > correct. If the window is evaluating "o", then the initial display of the window should show the properties of "o" at the time the window is created. It isn't doing that, it's showing a previous version of the properties of "o".
Whiteboard: [console-2]
Component: Developer Tools → Developer Tools: Console
Filter on TARDIS.
Priority: -- → P3
The property panel was replaced by the newer variables view in bug 808370. Things should work as expected now. Please reopen if you notice any issues.
Status: REOPENED → RESOLVED
Closed: 14 years ago12 years ago
Resolution: --- → WORKSFORME
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: