TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

fix(dom): DOMRECTList index can return undefined

Open keithamus opened this issue 5 years ago • 3 comments

See https://drafts.fxtf.org/geometry-1/#domrectlist

keithamus avatar Apr 14 '20 11:04 keithamus

Thanks for helping. This is a generated file, so you have to adjust the source.

HolgerJeromin avatar Apr 14 '20 14:04 HolgerJeromin

The source that's here? https://github.com/microsoft/TSJS-lib-generator/blob/15a4678e0ef6de308e79451503e444e9949ee849/inputfiles/idl/Geometry%20Interfaces.widl#L79-L82 or something else?

keithamus avatar Apr 14 '20 14:04 keithamus

Hrm, interesting - it's reasonable that the WIDL you posted should generate an undefined union.

It's quite possible that the WIDL->DTS does not add the | undefined here for the sake of convenience (like we don't force it on array index accessors ) -- it might need an explicit override in the big JSON file

orta avatar Apr 14 '20 20:04 orta