Skip to content

Commit

Permalink
src-runtime/validateType.js: Test IArguments and ArrayBufferView
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfooman committed Jun 14, 2024
1 parent d347867 commit e5214bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src-runtime/validateType.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ function validateType(value, expect, loc, name, critical = true, warn, depth) {
}
warn(`${loc}> validateType> class> expected object, not '${value}'`);
return false;
case 'IArguments':
// Used in playcanvas-engine/src/core/tags.js
// Testable via physics/offset-collision example.
return value[Symbol.iterator] instanceof Function;
case 'ArrayBufferView':
return ArrayBuffer.isView(value);
}
}
//if (value === null) {
// /** @todo Add unit-tests/asserts tests to make sure this never happens */
Expand Down

0 comments on commit e5214bf

Please sign in to comment.