Question

Reading documentation about fileReader, and find out that they write methods using void operator, like this:

void readAsArrayBuffer (
        in Blob blob
);

just trying understand why they do write it like this? If there is any practical use of this syntax?

Later on it turns out not to be js at all, but IDL which is Interface Description Language.

FYI: before asking this question I do google and read about actual void operator in JS. So please there no needs reffer me back. Question little bit blurry, but it has to deal with, why Mozilla has documentation about JavaScript written like this? In IDL which has little with actual JavaScript?

Was it helpful?

Solution

Mozilla uses IDL for in two ways

  • Web IDL: used in W3C specifications and such to describe Javascript APIs. These are the normative specifications.

  • XPCOM internal IDL dialect: The native Javascript APIs are implemented in C++. In Gecko's (Firefox's engine's) case, specifically in domain specific framework called XPCOM

As the linked page states, Gecko internally describes interfaces in language neutral IDL dialect, because those interface must be implemented both in native run-time (C++) and Javascript engine (Javascript).

In this case the IDL description is either copy-paste from the orignal Web IDL specification or from Gecko's internal implementation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top