[Bug 20836] What happens when a dictionary references itself?

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20836

--- Comment #3 from Boris Zbarsky <bzbarsky@mit.edu> ---
It sort of depends on the IDL used.

The IDL in comment 0 is I believe not actually valid WebIDL.  See the part of
http://dev.w3.org/2006/webapi/WebIDL/#idl-dictionaries starting "The type of a
dictionary member MUST NOT include the dictionary it appears on".  We don't
actually seem to enforce those rules in Gecko yet, but we enforce something
similar so if you try to use that IDL in Gecko, you get:

  TypeError: Loop in dictionary dependency graph

from the code generator for the bindings.

You could get around the spec restriction by doing something like this:

  dictionary L1 {
    L2 next;
  };
  dictionary L2 {
    L1 next;
  }

but that will hit the same situation as above in Gecko (and it's possible the
spec meant to disallow this too but just failed to).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Thursday, 31 January 2013 17:41:39 UTC