RESOLVED FIXED 158334
Web Inspector: API View of Native DOM APIs looks poor (TypeErrors for native getters)
https://bugs.webkit.org/show_bug.cgi?id=158334
Summary Web Inspector: API View of Native DOM APIs looks poor (TypeErrors for native ...
Joseph Pecoraro
Reported 2016-06-02 19:07:10 PDT
* SUMMARY API View of Native DOM APIs looks poor (TypeErrors for native getters). See attached screenshot. * STEPS TO REPRODUCE 1. js> dir(document.body) 2. Expand Prototypes in Console => TypeErrors everywhere
Attachments
[IMAGE] TypeErrors everywhere (588.96 KB, image/png)
2016-06-02 19:13 PDT, Joseph Pecoraro
no flags
[IMAGE] document.body before (393.79 KB, image/png)
2016-06-29 17:55 PDT, Joseph Pecoraro
no flags
[IMAGE] document.body after (298.29 KB, image/png)
2016-06-29 17:55 PDT, Joseph Pecoraro
no flags
[IMAGE] LoadEvent before (282.12 KB, image/png)
2016-06-29 17:55 PDT, Joseph Pecoraro
no flags
[IMAGE] LoadEvent after (224.05 KB, image/png)
2016-06-29 17:56 PDT, Joseph Pecoraro
no flags
[PATCH] Proposed Fix (9.66 KB, patch)
2016-06-29 18:11 PDT, Joseph Pecoraro
timothy: review+
[PATCH] For Landing (9.67 KB, patch)
2016-06-29 21:17 PDT, Joseph Pecoraro
no flags
Radar WebKit Bug Importer
Comment 1 2016-06-02 19:08:16 PDT
Joseph Pecoraro
Comment 2 2016-06-02 19:13:17 PDT
Created attachment 280403 [details] [IMAGE] TypeErrors everywhere
Blaze Burg
Comment 3 2016-06-03 09:02:53 PDT
Timothy Hatcher
Comment 4 2016-06-03 11:13:36 PDT
*** This bug has been marked as a duplicate of bug 153911 ***
Joseph Pecoraro
Comment 5 2016-06-03 13:37:53 PDT
Similar, but I'd have considered them different.
Joseph Pecoraro
Comment 6 2016-06-29 17:41:53 PDT
I'm going to unduplicated this, because it is different. I have a fix for this.
Joseph Pecoraro
Comment 7 2016-06-29 17:55:23 PDT
Created attachment 282395 [details] [IMAGE] document.body before
Joseph Pecoraro
Comment 8 2016-06-29 17:55:35 PDT
Created attachment 282396 [details] [IMAGE] document.body after
Joseph Pecoraro
Comment 9 2016-06-29 17:55:57 PDT
Created attachment 282397 [details] [IMAGE] LoadEvent before
Joseph Pecoraro
Comment 10 2016-06-29 17:56:12 PDT
Created attachment 282398 [details] [IMAGE] LoadEvent after
Joseph Pecoraro
Comment 11 2016-06-29 18:11:46 PDT
Created attachment 282400 [details] [PATCH] Proposed Fix
Joseph Pecoraro
Comment 12 2016-06-29 18:15:38 PDT
So the way this works is: The preview will show native accessors as values in the preview: js> loadEvent ▶︎ Event { type: "foo", ... } And when you expand, the first expansion _conveniently_ immediately shows you both own properties/functions and native getters up in the prototype chain: js> loadEvent ▼ Event [B] ownPropertyBoolean: true [S] type: "foo" ... ▶︎ Event Prototype And when you expand the prototypes, it will show the individual properties/functions + accessors on those prototypes: js> loadEvent ▼ Event [B] ownPropertyBoolean: true [S] type: "foo" ... ▼ Event Prototype [?] type: (Get) ... ▶︎ Object Prototype This is the best of both worlds. Quick access to values. Yet still having the ability to ultimately find out exactly which prototype the accessor came from.
Timothy Hatcher
Comment 13 2016-06-29 20:21:44 PDT
Comment on attachment 282400 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=282400&action=review > Source/JavaScriptCore/inspector/InjectedScriptSource.js:647 > + // Developers may create such a descriptors, so we should be resilient: "such a descriptors" => "such a descriptor"
Joseph Pecoraro
Comment 14 2016-06-29 21:17:46 PDT
Created attachment 282413 [details] [PATCH] For Landing
Joseph Pecoraro
Comment 15 2016-06-29 21:21:46 PDT
Note You need to log in before you can comment on or make changes to this bug.