Repository navigation
[js-api] Test descriptor-of-descriptor prototypes - #141
Conversation
Parameterize test/js-api/custom-descriptors/prototype.any.js over a 3-type struct-descriptor-metadescriptor chain so all prototype configuration and delegation tests run on both normal structs and descriptor structs.
|
The diff is a lot smaller without including whitespace changes. |
| if (proto == null) { | ||
| // Avoid TypeError when passing null as a non-nullable reference. | ||
| continue; | ||
| for (const [label, make] of [ |
There was a problem hiding this comment.
It looks like every struct in this file now has a descriptor that also has a descriptor. The simple case is gone: where descriptor of the struct has no descriptor of its own. Could we keep it somehow?
There was a problem hiding this comment.
Done. Now we have two rec groups: one with a struct and descriptor, and another with a struct, descriptor, and meta-descriptor.
| makeField(kWasmExternRef, false), | ||
| ]}); | ||
| builder.endRecGroup(); | ||
| }, `allowed prototypes (${label})`); |
There was a problem hiding this comment.
Could we also add one test that gives both levels different prototypes? Something like: put protoA in the descriptor's field and protoB in the meta-descriptor's field, then check the struct gets protoA and the descriptor gets protoB. Also worth checking that a null in one level doesn't fall back to the other level's prototype.
Parameterize test/js-api/custom-descriptors/prototype.any.js over a 3-type struct-descriptor-metadescriptor chain so all prototype configuration and delegation tests run on both normal structs and descriptor structs.