Prefer typeof over try/catch for feature detection.

This commit is contained in:
Colin Curtin 2013-05-11 17:23:34 -07:00
parent 98c0269edc
commit dccb6257fb

View file

@ -5,7 +5,7 @@ Elm.Native.Matrix2D = function(elm) {
elm.Native = elm.Native || {};
if (elm.Native.Matrix2D) return elm.Native.Matrix2D;
try { Float32Array; } catch(e) { Float32Array = Array; }
if (typeof Float32Array === 'undefined'){ Float32Array = Array; }
var A = Float32Array;
// layout of matrix in an array is