This makes it dangerous. However, while it may be that the contract is understood by the users of the interface, we currently have no way to communicate that contract to XPConnect. I'm thinking 'shared'. The entire string issue remains a big mess in my eyes. We may well have an interface coming along too.
Strings are the biggest example of the Failure to use the shared allocator problem mentioned above.
We are just not there yet. This is generally a mistake, though some structs really fit in 32 or 64 bit 'slots'. We do not have a way to reflect top level enums into XPConnect. Making use of the interface declaration as a namespace will both allow us to reflect them into XPConnect and also reduce global namespace pollution. I encourage people to do this wherever possible.