镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Node removes key/value from object when passing to function #29328

Description

@gorgos
  • Version: v11.13.0
  • Platform: Windows 10 Pro 1903 64-bit
  • Subsystem: ConEmu + Git Bash
  • Uname -a: MINGW64_NT-10.0 DESKTOP-LIIEHJM 2.11.2(0.329/5/3) 2018-11-10 14:38 x86_64 Msys
const execute = async tmpAfter => {
  console.log({ tmpAfter })
}

const tmpBefore = {
  maxUserCount: USER_COUNT,
  myJuriNodeAddress: nodes[nodeIndex].address,
  myJuriNodePrivateKey: nodes[nodeIndex].privateKeyBuffer,
  nodeIndex,
  wasCompliantData,
  failureOptions: {
    isNotRevealing: notRevealingConfig[nodeIndex],
    isSendingIncorrectResult: incorrectResultConfig[nodeIndex],
    isOffline: offlineConfig[nodeIndex],
    isSendingIncorrectDissent: incorrectDissentConfig[nodeIndex],
  },
}

console.log({ tmpBefore })
execute(tmpBefore)

->

{ tmpBefore: { [-as expected-] } }
{ tmpAfter: { [-as tmpBefore but without maxUserCount-] } }

I can add any new key + value and it doesn't get passed. But I can change the other keys and they update correctly. Some strange caching error I guess. Will try a reboot.

Update: Reboot did not fix it.

Activity

  1. mscdex commented on Aug 27, 2019

    @mscdex
    Contributor

    Do you have a more self-contained example? Can you test with the latest node v12.x?

  2. gorgos commented on Aug 27, 2019

    @gorgos
    Author

    A reboot of my brain helped. I had a hidden wrapper around execute which didn't pass the maxUserCount key/value. 🤦‍♂

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions