Open bzbarsky opened 6 years ago
Yeah, this is intentionally noted as not a supported capability:
// Non-method statics: use the actual constant values instead
Do you think we should make this clearer? Or, do you think this capability is important and we should make it possible somehow?
It's only important in the sense of making it simpler to write code using these primitives.
That said, I guess if you want to do Node.DOCUMENT_NODE you can get the original Node constructor and then just get its .DOCUMENT_NODE. It's non-configurable and non-writable so this is safe... as long as you know for sure it's there at all.
getOriginalProperty doesn't allow a target that is a WebIDL prototype or constructor. So to use it to get a constant you have to get an instance of that interface and that as target.
None of the other APIs being introduced here return WebIDL constants.