GeezerVison is showing github.com — Filled array displayed like [] in debug repl · Issue #6444 · nodejs/node
Filled array displayed like [] in debug repl #6444Labels v8 engineIssues and PRs related to the V8 dependency. Description
Steps:
- create file with this content:
- in console:
node debug fileName.js (enter)
- when stops at breakpoint, enable repl
- type this:
myVar = [{lol: 'lal'}]; (enter)
- type:
myVar (enter)
Expected:
[ { lol: 'lal' } ]
Actual:
[]
PS:
- if i start simple repl (not debug), this bug don't reproduce
- i can't reproduce this bug on v5.3.0 on windows 10
- sorry for my "bad" english
Activityaddaleax commented on Apr 28, 2016 cjihrig commented on Apr 28, 2016 It looks like something subtly changed from a number to a string. cjihrig@b64463f appears to fix the problem, but I'm unsure if it is the "correct" fix or not. addaleax commented on Apr 28, 2016 @cjihrig This may be a dumb question, but, like… is there any reason not to just do what the comment says? i.e. check for prop.name === 'length'? Good catch anyway!
That code has been around since 0fa3f2f and I think changing it to that would be correct here anyway.
// debug repl, node v5.11
> a = [1]; a.b = 2; a
[ 1 ]
// normal repl
> a = [1]; a.b = 2; a
[ 1, b: 2 ]
I’d expect these to match. cjihrig commented on Apr 28, 2016 Good question. It certainly seems like that would be fine, but there could be some historical context that I don't know about. I can put together a PR and see what people say :-) addaleax commented on Apr 28, 2016 evegreen commented on Apr 29, 2016
MetadataMetadatav8 engineIssues and PRs related to the V8 dependency. DevelopmentNo branches or pull requestsIssue actions
|