@@ -11905,6 +11905,17 @@ var identity = new Float32Array([
1190511905 0, 0, 1, 0,
1190611906 0, 0, 0, 1])
1190711907
11908+ var ab = ArrayBuffer
11909+ var dv = DataView
11910+
11911+ function isTypedArray(a) {
11912+ return ab.isView(a) && !(a instanceof dv)
11913+ }
11914+
11915+ function isArrayOrTypedArray(a) {
11916+ return Array.isArray(a) || isTypedArray(a)
11917+ }
11918+
1190811919function copyVec3(a, b) {
1190911920 a[0] = b[0]
1191011921 a[1] = b[1]
@@ -11992,8 +12003,8 @@ proto.update = function(options) {
1199212003 var opt = options[name]
1199312004 var prev = this[name]
1199412005 var next
11995- if(nest ? (Array.isArray (opt) && Array.isArray (opt[0])) :
11996- Array.isArray (opt) ) {
12006+ if(nest ? (isArrayOrTypedArray (opt) && isArrayOrTypedArray (opt[0])) :
12007+ isArrayOrTypedArray (opt) ) {
1199712008 this[name] = next = [ cons(opt[0]), cons(opt[1]), cons(opt[2]) ]
1199812009 } else {
1199912010 this[name] = next = [ cons(opt), cons(opt), cons(opt) ]
@@ -12011,7 +12022,7 @@ proto.update = function(options) {
1201112022 var BOOLEAN = parseOption.bind(this, false, Boolean)
1201212023 var STRING = parseOption.bind(this, false, String)
1201312024 var COLOR = parseOption.bind(this, true, function(v) {
12014- if(Array.isArray (v)) {
12025+ if(isArrayOrTypedArray (v)) {
1201512026 if(v.length === 3) {
1201612027 return [ +v[0], +v[1], +v[2], 1.0 ]
1201712028 } else if(v.length === 4) {
0 commit comments