Skip to content

Commit 27d85fe

Browse files
committed
TYPED_ARRAY_CTORS is overwritten to avoid possible ReferenceError issues
1 parent ddf7026 commit 27d85fe

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ var GLOBAL = (function getGlobal () {
1111
})();
1212

1313
var TYPED_ARRAY_CTORS = {
14-
'Int8Array': Int8Array,
15-
'Uint8Array': Uint8Array,
16-
'Uint8ClampedArray': Uint8ClampedArray,
17-
'Int16Array': Int16Array,
18-
'Uint16Array': Uint16Array,
19-
'Int32Array': Int32Array,
20-
'Uint32Array': Uint32Array,
21-
'Float32Array': Float32Array,
22-
'Float64Array': Float64Array
14+
'Int8Array': typeof Int8Array !== 'undefined' ? Int8Array : void 0,
15+
'Uint8Array': typeof Uint8Array !== 'undefined' ? Uint8Array : void 0,
16+
'Uint8ClampedArray': typeof Uint8ClampedArray !== 'undefined' ? Uint8ClampedArray : void 0,
17+
'Int16Array': typeof Int16Array !== 'undefined' ? Int16Array : void 0,
18+
'Uint16Array': typeof Uint16Array !== 'undefined' ? Uint16Array : void 0,
19+
'Int32Array': typeof Int32Array !== 'undefined' ? Int32Array : void 0,
20+
'Uint32Array': typeof Uint32Array !== 'undefined' ? Uint32Array : void 0,
21+
'Float32Array': typeof Float32Array !== 'undefined' ? Float32Array : void 0,
22+
'Float64Array': typeof Float64Array !== 'undefined' ? Float64Array : void 0
2323
};
2424

2525
var ARRAY_BUFFER_SUPPORTED = typeof ArrayBuffer === 'function';

0 commit comments

Comments
 (0)