Skip to content

Commit cd8bf8f

Browse files
Test against Float16Array only on supported runtime versions
1 parent f8feba8 commit cd8bf8f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

test/_constants.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ export const illegalArgumentLists = [
3434
{ description: "typed array (int16)", value: new Int16Array() },
3535
{ description: "typed array (int32)", value: new Int32Array() },
3636
{ description: "typed array (int64)", value: new BigInt64Array() },
37-
{ description: "typed array (float16)", value: new Float16Array() },
3837
{ description: "typed array (float32)", value: new Float32Array() },
3938
{ description: "typed array (float64)", value: new Float64Array() },
4039
{ description: "typed array (clamped)", value: new Uint8ClampedArray() },
4140
];
4241

42+
if (Object.prototype.hasOwnProperty.call(globalThis, "Float16Array")) {
43+
illegalArgumentLists.push({
44+
description: "typed array (float16)",
45+
value: new Float16Array(),
46+
});
47+
}
48+
4349
/* OS platforms (based on https://nodejs.org/api/os.html#osplatform) */
4450
export const osAix = "aix";
4551
export const osDarwin = "darwin";

0 commit comments

Comments
 (0)