Bug 201861 - Web Inspector: show autocomplete entries for non-index properties on arrays
Summary: Web Inspector: show autocomplete entries for non-index properties on arrays
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-16 21:50 PDT by Devin Rousso
Modified: 2019-09-16 21:50 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2019-09-16 21:50:33 PDT
(In reply to Devin Rousso from https://webkit.org/b/143589#26)
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=376644&action=review
> 
> >> Source/JavaScriptCore/inspector/InjectedScriptSource.js:-743
> >> -        // For array types with a large length we attempt to skip getOwnPropertyNames and instead just sublist of indexes.
> > 
> > I think `isArrayLike` worked around the fact that `Object.getOwnPropertyNames(o)` for a TypedArray of 1000000 returns a massive array. Hence this comment!
> > 
> > For example:
> > 
> >     console.time();
> >     console.log(Object.getOwnPropertyNames(new Uint8Array(1000000)).length);
> >     console.timeEnd();
> > 
> > Outputs on my very fast iMacPro:
> > 
> >     [Log] 1000000
> >     [Debug] default: 312.283ms
> > 
> > Not to mention the temporary memory spike of a million strings of varying length.
> > 
> > So I think we will still want to keep the isArrayLike path:
> > 
> >    1. For performance
> >    2. To avoid running out of memory
> 
> One kinda "sucky" part of this is that we don't show autocompletion for any custom values on array-like objects.  But given that that's what we have now, I'm inclined to leave this as is and have it as a followup.