Skip to content

Mutating Resizable element like List as Hash key won't work correctly  #153

@jonnyboyC

Description

@jonnyboyC

Problem

List's are not immutable further more given that we are using a Gc managed resizble array it is expected the the value points directly to the collection. There may be potentially forwarding pointers which makes it so equality must really be down on the allocation pointers.

Our current implementation of Value doesn't take this into account and means a mutation to a List key after it was set may give unexpected behavior.

Example

let a = [1, 2, 3];
let b = { a: 5 };
a.push(4)
// ??? 
b[a]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions