Bug 201861
Summary: | Web Inspector: show autocomplete entries for non-index properties on arrays | ||
---|---|---|---|
Product: | WebKit | Reporter: | Devin Rousso <hi> |
Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | inspector-bugzilla-changes |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=143589 |
Devin Rousso
(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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |