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.

17 lines
513 B

3 months ago
  1. 'use strict';
  2. var globalThis = require('../internals/global-this');
  3. var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');
  4. var arrayBufferByteLength = require('../internals/array-buffer-byte-length');
  5. var DataView = globalThis.DataView;
  6. module.exports = function (O) {
  7. if (!NATIVE_ARRAY_BUFFER || arrayBufferByteLength(O) !== 0) return false;
  8. try {
  9. // eslint-disable-next-line no-new -- thrower
  10. new DataView(O);
  11. return false;
  12. } catch (error) {
  13. return true;
  14. }
  15. };