UNPKG

arraybuffer.prototype.detached

Version:

ES Proposal spec-compliant shim for ArrayBuffer.prototype.detached

17 lines (13 loc) 447 B
'use strict'; var implementation = require('./implementation'); var supportsDescriptors = require('has-property-descriptors')(); var gOPD = require('gopd'); module.exports = function getPolyfill() { if (supportsDescriptors && typeof ArrayBuffer === 'function') { var descriptor = gOPD(ArrayBuffer.prototype, 'detached'); if (descriptor && typeof descriptor.get === 'function') { return descriptor.get; } } return implementation; };