Skip to content

Commit 2d98fce

Browse files
authored
Add Float16Array to the list of valid basic types (#601)
Added to Web IDL in whatwg/webidl#1398 and already used in the definition of `ArrayBufferView`. The test is not fantastically useful but will allow to make the test fail next time we need to add a basic type to the list.
1 parent 0e31f6e commit 2d98fce

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

src/lib/study-webidl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const basicTypes = new Set([
6363
'DOMString', // https://webidl.spec.whatwg.org/#idl-DOMString
6464
'double', // https://webidl.spec.whatwg.org/#idl-double
6565
'float', // https://webidl.spec.whatwg.org/#idl-float
66+
'Float16Array', // https://webidl.spec.whatwg.org/#idl-Float16Array
6667
'Float32Array', // https://webidl.spec.whatwg.org/#idl-Float32Array
6768
'Float64Array', // https://webidl.spec.whatwg.org/#idl-Float64Array
6869
'Int16Array', // https://webidl.spec.whatwg.org/#idl-Int16Array

test/study-webidl.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,53 @@ interface Valid {};
3232
assertNbAnomalies(report, 0);
3333
});
3434

35+
it('knows about basic IDL type', () => {
36+
const report = analyzeIdl(`
37+
[Global=Window,Exposed=*]
38+
interface ValidBasicTypes {
39+
attribute any test1;
40+
attribute ArrayBuffer test2;
41+
attribute bigint test3;
42+
attribute boolean test4;
43+
attribute byte test5;
44+
attribute ByteString test6;
45+
attribute DataView test7;
46+
attribute DOMString test8;
47+
attribute double test9;
48+
attribute float test10;
49+
attribute Float16Array test11;
50+
attribute Float32Array test12;
51+
attribute Float64Array test13;
52+
attribute Int16Array test14;
53+
attribute Int32Array test15;
54+
attribute Int8Array test16;
55+
attribute long long test17;
56+
attribute long test18;
57+
attribute object test19;
58+
attribute octet test20;
59+
attribute SharedArrayBuffer test21;
60+
attribute short test22;
61+
attribute symbol test23;
62+
attribute BigUint64Array test24;
63+
attribute BigInt64Array test25;
64+
attribute Uint16Array test26;
65+
attribute Uint32Array test27;
66+
attribute Uint8Array test28;
67+
attribute Uint8ClampedArray test29;
68+
attribute unrestricted double test30;
69+
attribute unrestricted float test31;
70+
attribute unsigned long long test32;
71+
attribute unsigned long test33;
72+
attribute unsigned short test34;
73+
attribute USVString test35;
74+
attribute undefined test36;
75+
attribute CSSOMString test37;
76+
attribute WindowProxy test38;
77+
};
78+
`);
79+
assertNbAnomalies(report, 0);
80+
});
81+
3582
it('reports invalid IDL', () => {
3683
const report = analyzeIdl(`
3784
[Global=Window,Exposed=*]

0 commit comments

Comments
 (0)