提交 3d2dd7ab 编写于 作者: Y Younes Riad 提交者: Mr.doob

Add typechecking for array argument in BufferAttribute (#9445)

上级 7793c8b3
......@@ -10,6 +10,12 @@ import { _Math } from '../math/Math';
function BufferAttribute( array, itemSize, normalized ) {
if (array.buffer instanceof ArrayBuffer === false) {
throw new TypeError( 'THREE.BufferAttribute: array should be an instance of Uint8Array, Int8Array, Uint16Array, Int16Array, or Float32Array.' );
}
this.uuid = _Math.generateUUID();
this.array = array;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册