If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Expanding a property in the Object Inspector whose type is Generator causes lockup

VERIFIED FIXED

Status

()

Firefox
Developer Tools
VERIFIED FIXED
7 years ago
7 years ago

People

(Reporter: rc, Assigned: msucan)

Tracking

({hang})

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [console-1], URL)

Attachments

(2 attachments, 3 obsolete attachments)

(Reporter)

Description

7 years ago
In the web console, open an Object inspector that contains a Generator. Click the arrow to expand it, browser locks up, beachballs, etc.
(Reporter)

Comment 1

7 years ago
see test case at the above URL
(Reporter)

Updated

7 years ago
Keywords: hang
(Assignee)

Comment 2

7 years ago
Created attachment 510760 [details] [diff] [review]
proposed patch

Proposed patch, with fixes for the autocomplete, eval result inspection and for the object inspector panel code. Included a mochitest which checks that the three parts of the Web Console do not fail with iterators and generators. I used the MDN docs to write down the main types of supported iters and gens.

Feedback for improvements is welcome! Thanks!
Assignee: nobody → mihai.sucan
Status: NEW → ASSIGNED
Attachment #510760 - Flags: feedback?(rcampbell)
(Assignee)

Updated

7 years ago
Whiteboard: [patchclean:0208]
Version: unspecified → Trunk
(Reporter)

Comment 3

7 years ago
Comment on attachment 510760 [details] [diff] [review]
proposed patch

+      let str = aResult + "";

toString() ?

f+=me!
Attachment #510760 - Flags: feedback?(rcampbell) → feedback+
(Assignee)

Comment 4

7 years ago
Created attachment 511336 [details] [diff] [review]
updated patch

Updated the patch. Thanks for the feedback+ Rob!

Asking for review from Shawn.
Attachment #510760 - Attachment is obsolete: true
Attachment #511336 - Flags: review?(sdwilsh)
(Assignee)

Updated

7 years ago
Whiteboard: [patchclean:0208] → [patchclean:0210]
Comment on attachment 511336 [details] [diff] [review]
updated patch

>+++ b/toolkit/components/console/hudservice/HUDService.jsm
>+  // Skip Iterators and Generators.
>+  if (typeof obj == "object") {
>+    if (typeof obj.__iterator__ == "function" ||
>+        obj.constructor && obj.constructor.name == "Iterator") {
>+      return null;
>+    }
>+
>+    let str = obj.toString();
>+    if (typeof obj.next == "function" &&
>+        str.indexOf("[object Generator") == 0) {
>+      return null;
>+    }
>+  }
You do this code twice, which means you should pull it into a helper method (like isIteratorOrGenerator(aObject) perhaps)

>+++ b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632347_iterators_generators.js
>@@ -0,0 +1,99 @@
>+/*
>+ * Any copyright is dedicated to the Public Domain.
>+ * http://creativecommons.org/publicdomain/zero/1.0/
>+ *
>+ * Contributor(s):
>+ *   Mihai Șucan <mihai.sucan@gmail.com>
>+ */
nit: just https://www.mozilla.org/MPL/boilerplate-1.1/pd-c

r=sdwilsh
Attachment #511336 - Flags: review?(sdwilsh) → review+
(Assignee)

Comment 6

7 years ago
Created attachment 518135 [details] [diff] [review]
patch update 2

Thanks for the review+ Shawn! Updated the patch as requested.
Attachment #511336 - Attachment is obsolete: true
(Assignee)

Updated

7 years ago
Whiteboard: [patchclean:0210] → [patchclean:0309][checkin][future-release]

Updated

7 years ago
Whiteboard: [patchclean:0309][checkin][future-release] → [patchclean:0309][checkin][future-release][console-1]
(Assignee)

Comment 7

7 years ago
Created attachment 521241 [details] [diff] [review]
[in-devtools] rebased patch

Ready to land (mozilla-central, default branch, on top of bugs 619598 and 618311).
Attachment #518135 - Attachment is obsolete: true
(Assignee)

Updated

7 years ago
Whiteboard: [patchclean:0309][checkin][future-release][console-1] → [patchclean:0323][checkin][console-1]
(Reporter)

Comment 8

7 years ago
Comment on attachment 521241 [details] [diff] [review]
[in-devtools] rebased patch

checked into devtools

http://hg.mozilla.org/projects/devtools/rev/b224e897c616
Attachment #521241 - Attachment description: rebased patch → [in-devtools] rebased patch
(Reporter)

Updated

7 years ago
Whiteboard: [patchclean:0323][checkin][console-1] → [patchclean:0323][merge-moz-central][console-1]
(Reporter)

Comment 9

7 years ago
http://tinderbox.mozilla.org/showlog.cgi?log=Devtools/1301077938.1301081696.7097.gz&fulltext=1

TEST-PASS | chrome://mochitests/content/browser/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632347_iterators_generators.js | iter2 is correctly displayed in the Property Panel
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632347_iterators_generators.js | window.parent is correctly displayed in the Property Panel
JavaScript strict warning: resource://gre/modules/NetworkPrioritizer.jsm, line 117: reference to undefined property aBrowser.webNavigation
INFO TEST-END | chrome://mochitests/content/browser/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_632347_iterators_generators.js | finished in 845ms
TEST-INFO | checking window state
(Reporter)

Comment 10

7 years ago
disabled test in devtools:

http://hg.mozilla.org/projects/devtools/rev/c8e0ffa5b44b
(Assignee)

Comment 11

7 years ago
Created attachment 522085 [details] [diff] [review]
test fix for debug builds

This fixes the test in debug builds. Works for me.

It applies cleanly in the devtools repo, default branch.
(Reporter)

Updated

7 years ago
Whiteboard: [patchclean:0323][merge-moz-central][console-1] → [console-1][merge-m-c]
(Reporter)

Comment 12

7 years ago
http://hg.mozilla.org/mozilla-central/rev/b224e897c616
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Whiteboard: [console-1][merge-m-c] → [console-1]
Verified on:
Build identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.2a1pre) Gecko/20110403 Firefox/4.2a1pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.