-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repl completion for large buffers fails to display named properties #21446
Comments
The relevant part is Lines 910 to 918 in 4dbfb09
In order to list accessible properties, the REPL script has to obtain all properties of the given object. Without the above check, Node.js may crash due to out of memory error. I don't think this is fixable. |
I think it might be fixable. We should lookup named properties first, which should be possible. |
Interesred in picking this up.. need some guidance |
Re: @͏Fishrock123 I would be very happy to see how it can be fixed. In order to obtain named properties of an object, the repl script should call > var a = Buffer.alloc(2 ** 30)
undefined
> a.someProperty = 'someValue'
'someValue'
> a.
(node:1932) REPLWarning: The current array, Buffer or TypedArray has too many entries. Certain properties may be missing from completion output. In order to enumerate > Object.keys(a)
RangeError: Invalid array length
at Function.keys (<anonymous>)
> Object.getOwnPropertyNames(a)
FATAL ERROR: invalid table size Allocation failed - JavaScript heap out of memory |
Not without changes to V8 first. There is currently no way to retrieve a bounded number of own properties. We might be able to make do with a for/in loop and check each key with |
Due to a new API it's possible to skip the indices. That allows to use auto completion with big (typed) arrays. Fixes: nodejs#21446
Due to a new API it's possible to skip the indices. That allows to use auto completion with big (typed) arrays. PR-URL: #22408 Fixes: #21446 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Due to a new API it's possible to skip the indices. That allows to use auto completion with big (typed) arrays. PR-URL: #22408 Fixes: #21446 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
When alloc a large buffer, and input
a.
then press tab. It's a warning.But it works well, when alloc a small buffer.
The text was updated successfully, but these errors were encountered: