Skip to content

Bigint should be included when checking whether the value is primitive #11769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tzdy opened this issue Nov 13, 2020 · 1 comment
Closed

Bigint should be included when checking whether the value is primitive #11769

Tzdy opened this issue Nov 13, 2020 · 1 comment

Comments

@Tzdy
Copy link

Tzdy commented Nov 13, 2020

Version

2.6.11

Reproduction link

https://codepen.io/Tsdy/pen/mdEaYzL

Steps to reproduce

src/shared/util.js

/**
 * Check if value is primitive.
 */
function isPrimitive (value){
  return (
    typeof value === 'string' ||
    typeof value === 'number' ||
    // $flow-disable-line
    typeof value === 'symbol' ||
    typeof value === 'boolean'
  )
}
console.log(isPrimitive(100n));
// false

What is expected?

Bigint should be included in the primitive type

What is actually happening?

console.log(isPrimitive(100n));
// false

@posva
Copy link
Member

posva commented Nov 13, 2020

Duplicate of #11126

@posva posva marked this as a duplicate of #11126 Nov 13, 2020
@posva posva closed this as completed Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants