Urara-Blog/node_modules/.pnpm-store/v3/files/93/6d7534677f52a7d9972b4298bf5c30ff2d0a0d214536e3c2aec6293cdf53d10dc44d9ca531780ae12bcbefe630d6949ad72830980dab1b3a299875ebd3b93a
2022-08-14 01:14:53 +08:00

14 lines
364 B
Text

'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
// https://262.ecma-international.org/11.0/#sec-binaryand
module.exports = function BinaryAnd(x, y) {
if ((x !== 0 && x !== 1) || (y !== 0 && y !== 1)) {
throw new $TypeError('Assertion failed: `x` and `y` must be either 0 or 1');
}
return x & y;
};