Open Yoric opened 6 years ago
So, one way to implement this with or without standardization would simply to have a file that maps each string enum constant to a value, each identifier to a value, possibly with some static analysis/commit hook that ensures that we never remove/alter existing values.
To actually standardize this, we could either manually give a number to each value, with the same guarantee, or come up with a spec to derive the numbers from each successive version of the webidl. For instance:
""
(the null interface) is assigned 0;""
(the null string enum) is assigned 0, regardless of string enum;The only real drawbacks, I believe, are that:
Having unique, stable-with-time numeric identifiers for each node and (in a separate namespace) each string enum value would be useful for the following purposes:
Cc @syg . Note that this spec has no real implication on syntax, so would probably be part of the container format.