RE: Maybe we should think about Interface.isInterface functions again

+1 to the throwing-getter being very confusing; `undefined` would make more sense, just like it would for any other property that does not apply such as `asdf` or `qqqqqqq`.

Anyway, nitpicking this particular example is not productive---we don't want to be the guys responding to multiple instances of "please add this feature" with "ur doin it wrong"---so we can leave the what-should-the-getter-do as a side discussion. Anne points out a great example where, even without weird throwing getters, `instanceof Node` doesn't do what you want.

It seems like there's two tests being asked for here:

1. "is a node," which `HTMLElement.prototype` should actually pass (it's the prototypical `HTMLElement`, and will have all the same properties of any other `Node`). This would in my opinion be covered by `x instanceof Node`.
2. "can be appended," which `HTMLElement.prototype` should fail. This is where introducing something new would make sense, e.g. `node.canAppendChild(HTMLElement.prototype) === false`. Of course we'd also have `node.canAppendChild({ arbitrary: "object" }) === false` and so on.

Received on Saturday, 20 July 2013 19:37:30 UTC