Skip to content

Serious Bug in v10.x.x : Function Map.values truncates elements #27882

Description

@Tunga37

Version: v10.15.3 (10.x.x)
Platform: Linux 4.15.0-50-generic #54-Ubuntu SMP Mon May 6 18:46:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

This is the code that demonstrates the problem

const m = new Map();
m.set(1,'a');
m.set(2,'b');
m.set(3,'c');
m.set(4,'d');
m.set(5,'e');
m.set(6,'f');

//before delete [Map Iterator] { 'a', 'b', 'c', 'd', 'e', 'f' }
console.log('before delete',m.values());

m.delete(1);

//after delete [Map Iterator] { 'c', 'd', 'e', 'f' }
console.log('after delete',m.values());

//element 'b' has been truncated

It's probably more v8 problem than node itself (in node v12.x.x this is fixed) but the truth is ... this is very serious bug in node v10.x.x and I had to jump out of version 10.x.x because of this.

Activity

  1. changed the title [-]Function Map.values truncates elements[/-] [+]Serious Bug in v10.x.x : Function Map.values truncates elements[/+] on May 26, 2019
  2. added
    utilIssues and PRs related to the built-in util module.
    v8 engineIssues and PRs related to the V8 dependency.
    on May 26, 2019
  3. addaleax commented on May 26, 2019

    @addaleax
    Member

    I think this was fixed in 0afcb9a (aka v8/v8@88f8fe1). I’ll attempt a backport, that seems doable to me.

    I don’t think this is a super-serious bug – to be clear, what is broken is the display of m.values() when using console.log or util.inspect(), not the actual functionality of m.values(), as far as I can tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    utilIssues and PRs related to the built-in util module.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions