Skip to content

Map get fails on BigInt key #577

@dckc

Description

@dckc

Steps to Reproduce

  1. xst -e 'const store = new Map([[1n, "abc"]]); print(store.get(1n))'
  2. See undefined

Expected behavior
print abc

Other information

I thought maybe a Map's key had to be an Object, but that's WeakMap. "A Map's keys can be any value (including functions, objects, or any primitive)." -- MDN

I checked the XS conformance docs and didn't find anything about this. That suggests test262 doesn't cover this. odd, that.

node and browser consoles both show...

> const store = new Map([[1n, "abc"]]); store.get(1n)
'abc'

context:

As part of Agoric/agoric-sdk#2486 , I'm running zoe/test/unitTests/test-fakePriceAuthority.js and the assertion at store.js line 35 is failing.

cc @erights @katelynsills

Build environment: linux
Target device: xst, xsnap, agoric

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