UNPKG

525 BJavaScriptView Raw
1'use strict';
2var uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');
3var classof = require('../internals/classof-raw');
4
5var $TypeError = TypeError;
6
7// Includes
8// - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
9// - If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
10module.exports = uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) {
11 if (classof(O) !== 'ArrayBuffer') throw new $TypeError('ArrayBuffer expected');
12 return O.byteLength;
13};