IsSharedArrayBuffer.js 461 B

12345678910111213141516171819
  1. 'use strict';
  2. var GetIntrinsic = require('get-intrinsic');
  3. var $TypeError = GetIntrinsic('%TypeError%');
  4. var Type = require('./Type');
  5. var isSharedArrayBuffer = require('is-shared-array-buffer');
  6. // https://262.ecma-international.org/8.0/#sec-issharedarraybuffer
  7. module.exports = function IsSharedArrayBuffer(obj) {
  8. if (Type(obj) !== 'Object') {
  9. throw new $TypeError('Assertion failed: Type(O) is not Object');
  10. }
  11. return isSharedArrayBuffer(obj);
  12. };