Skip to content

fix: allow keys from Object.prototype like 'constructor' etc as value in attribute 'key'

Luke Duncalfe requested to merge github/fork/rx-837/fix-checkDuplicateKeys into main

Created by: rx-837

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information: When i use "constructor" as attribute "key", i have warning in console: - [Vue warn]: Duplicate keys detected: 'constructor'. This may cause an update error.

https://codesandbox.io/s/angry-stitch-kb2go1

It's behavior because of incorrect object creation inside checkDuplicateKeys function.

const seenKeys = {} - mean make object with default prototype(Object.prototype).

Merge request reports