Bug 198395

Summary: Web Inspector: remove RemoteObject.prototype.getPropertyDescriptorsAsObject
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, hi, inspector-bugzilla-changes, mattbaker, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews102 for mac-highsierra
none
Archive of layout-test-results from ews105 for mac-highsierra-wk2
none
Archive of layout-test-results from ews112 for mac-highsierra
none
Patch none

Description Devin Rousso 2019-05-30 15:55:40 PDT
When calling `remoteObject.getPropertyDescriptorsAsObject`, if one of the returned property descriptors is named `__proto__`, it will replace the `__proto__` of the plain object created for that function with the `WI.PropertyDescriptor`, altering the prototype chain.  This is not a good thing.

Since this function is only used in a few places, we should remove it entirely.
Comment 1 Devin Rousso 2019-05-30 19:40:28 PDT
Created attachment 371022 [details]
Patch
Comment 2 EWS Watchlist 2019-05-30 20:25:52 PDT Comment hidden (obsolete)
Comment 3 EWS Watchlist 2019-05-30 20:25:53 PDT Comment hidden (obsolete)
Comment 4 EWS Watchlist 2019-05-30 20:51:55 PDT Comment hidden (obsolete)
Comment 5 EWS Watchlist 2019-05-30 20:51:57 PDT Comment hidden (obsolete)
Comment 6 EWS Watchlist 2019-05-30 21:26:40 PDT Comment hidden (obsolete)
Comment 7 EWS Watchlist 2019-05-30 21:26:42 PDT Comment hidden (obsolete)
Comment 8 Devin Rousso 2019-05-30 21:46:30 PDT
Created attachment 371033 [details]
Patch

Integer vs String comparison -.-
Comment 9 Matt Baker 2019-06-03 13:18:49 PDT
Comment on attachment 371033 [details]
Patch

r=me, nice fix.

Since ErrorObjectView.prototype.update is only called internally, and isn't an override, let's make it private or even inline it inside ErrorObjectView.prototype.expand, which is the only call site.
Comment 10 Devin Rousso 2019-06-03 13:29:02 PDT
(In reply to Matt Baker from comment #9)
> Since ErrorObjectView.prototype.update is only called internally, and isn't an override, let's make it private or even inline it inside ErrorObjectView.prototype.expand, which is the only call site.
I'd rather not make a change like this as it's frankly unnecessary for this patch, and could be more prone to issues than what I'd tested.  Furthermore, I'm actually a fan of the idea of modularizing functionality, even if it's only used once, as it makes code easier to read and more future-capable.
Comment 11 WebKit Commit Bot 2019-06-03 13:58:50 PDT
Comment on attachment 371033 [details]
Patch

Clearing flags on attachment: 371033

Committed r246046: <https://trac.webkit.org/changeset/246046>
Comment 12 WebKit Commit Bot 2019-06-03 13:58:52 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Radar WebKit Bug Importer 2019-06-03 13:59:20 PDT
<rdar://problem/51366626>