Skip to content
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

fix(BitField): throw an error if bit to resolve is undefined #5565

Merged
merged 9 commits into from Jun 9, 2021
1 change: 1 addition & 0 deletions src/util/BitField.js
Expand Up @@ -41,6 +41,7 @@ class BitField {
* @returns {boolean}
*/
has(bit) {
if (typeof bit === 'undefined') return false;
if (Array.isArray(bit)) return bit.every(p => this.has(p));
bit = this.constructor.resolve(bit);
kevinbioj marked this conversation as resolved.
Show resolved Hide resolved
return (this.bitfield & bit) === bit;
Expand Down