aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/modules/$.typed.js
blob: ced241268115eda7f313ec2010877fa7a72ecd6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var global = require('./$.global')
  , hide   = require('./$.hide')
  , uid    = require('./$.uid')
  , TYPED  = uid('typed_array')
  , VIEW   = uid('view')
  , ABV    = !!(global.ArrayBuffer && global.DataView)
  , ARRAYS = true
  , i = 0, l = 9;

var TypedArrayConstructors = [
  'Int8Array',
  'Uint8Array',
  'Uint8ClampedArray',
  'Int16Array',
  'Uint16Array',
  'Int32Array',
  'Uint32Array',
  'Float32Array',
  'Float64Array'
];

while(i < l){
  var Typed = global[TypedArrayConstructors[i++]];
  if(Typed){
    hide(Typed.prototype, TYPED, true);
    hide(Typed.prototype, VIEW, true);
  } else ARRAYS = false;
}

module.exports = {
  ARRAYS: ARRAYS,
  ABV:    ABV,
  CONSTR: ARRAYS && ABV,
  TYPED:  TYPED,
  VIEW:   VIEW
};