File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 5
5
6
6
"rules": {
7
7
"id-length": 0,
8
+ "max-params": 0,
8
9
"max-statements": 0,
9
10
"multiline-comment-style": 0,
10
11
"new-cap": [2, {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ var callBind = require ( 'call-bind' ) ;
4
+
3
5
var implementation = require ( './implementation' ) ;
4
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
+
5
17
module . exports = function getPolyfill ( ) {
6
- return ( typeof ArrayBuffer === 'function' && ArrayBuffer . prototype . slice ) || implementation ;
18
+ return ( typeof ArrayBuffer === 'function' && ArrayBuffer . prototype . slice )
19
+ || ownSliceWrapper
20
+ || implementation ;
7
21
} ;
You can’t perform that action at this time.
0 commit comments