Javascript 在chrome上的阵列U32上切片

Javascript 在chrome上的阵列U32上切片,javascript,Javascript,我正在使用这个库“Zen Photon Garden”,我在chrome上遇到了一些问题(如果我调整画布的大小):“Uncaught TypeError:this.Z32.slice不是函数rayworker asm.js:461” 我发现这个片段,在这个例子中,它只受firefox支持,我如何修复它 this.heap = new ArrayBuffer(0x800000); this.F32 = new Float32Array(this.heap); this.U32 = new Uint

我正在使用这个库“Zen Photon Garden”,我在chrome上遇到了一些问题(如果我调整画布的大小):“Uncaught TypeError:this.Z32.slice不是函数rayworker asm.js:461”

我发现这个片段,在这个例子中,它只受firefox支持,我如何修复它

this.heap = new ArrayBuffer(0x800000);
this.F32 = new Float32Array(this.heap);
this.U32 = new Uint32Array(this.heap);
this.zeroes = new ArrayBuffer(0x10000);
this.Z32 = new Uint32Array(this.zeroes);

类似于
Array.prototype.slice.call(this.Z32,0,l>>2)
?“未捕获的TypeError:无法读取未定义的属性'slice'”您在尝试什么?在样本
slice
中,从
Array.prototype
中,不能取消定义this.Z32.prototype.slice和this.Z32.prototype.slice.call。顺便说一句,在这里,但正如您看到的,我没有使用
this.Z32
-因为它是对象,并且没有
prototype
属性,所以您应该检查我提供的变量:
Array.prototype.slice.call(this.Z32,0,l>>2)
类似于
Array.prototype.slice.call(this.Z32,0,l>>2)
?未捕获的TypeError:无法读取未定义的“你想干什么?在样本
slice
中,从
Array.prototype
中,不能取消定义this.Z32.prototype.slice和this.Z32.prototype.slice.call。顺便说一句,在这里,但正如您看到的,我没有使用
this.Z32
-因为它是对象,并且没有
prototype
属性,所以您应该检查我提供的变量:
Array.prototype.slice.call(this.Z32,0,l>>2)
this.heap = new ArrayBuffer(0x800000);
this.F32 = new Float32Array(this.heap);
this.U32 = new Uint32Array(this.heap);
this.zeroes = new ArrayBuffer(0x10000);
this.Z32 = new Uint32Array(this.zeroes);