web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
364 B

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