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 |
|
---|
3 | var callBind = require('call-bind');
|
---|
4 |
|
---|
5 | var implementation = require('./implementation');
|
---|
6 |
|
---|
7 | var ownSlice = typeof ArrayBuffer === 'function' && new ArrayBuffer(0).slice;
|
---|
8 | var ownSliceBound = ownSlice && callBind(ownSlice);
|
---|
9 | var 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 |
|
---|
17 | module.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.