source: imaps-frontend/node_modules/arraybuffer.prototype.slice/polyfill.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 638 bytes
Line 
1'use strict';
2
3var callBind = require('call-bind');
4
5var implementation = require('./implementation');
6
7var ownSlice = typeof ArrayBuffer === 'function' && new ArrayBuffer(0).slice;
8var ownSliceBound = ownSlice && callBind(ownSlice);
9var ownSliceWrapper = ownSliceBound && function slice(start, end) {
10 /* eslint no-invalid-this: 0 */
11 if (arguments.length < 2) {
12 return ownSliceBound(this, arguments.length > 0 ? start : 0);
13 }
14 return ownSliceBound(this, start, end);
15};
16
17module.exports = function getPolyfill() {
18 return (typeof ArrayBuffer === 'function' && ArrayBuffer.prototype.slice)
19 || ownSliceWrapper
20 || implementation;
21};
Note: See TracBrowser for help on using the repository browser.