- From: Cameron McCormack <cam@mcc.id.au>
- Date: Thu, 21 Jun 2012 13:20:06 +1000
- To: Boris Zbarsky <bzbarsky@MIT.EDU>
- CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
I think what I really want to write is: if (n.is(Node)) ... but I don't think that will fly. It might be handy to be able to accept null and return true, too, although you could do that with the new ".?" operator. Here are some method names I came up with (not all serious contenders): Node.describes(n) Node.defines(n) Node.names(n) Node.characterizes(n) Node.labels(n) Node.hasInstance(n) Node.has(n) Node.isValue(n) Node.isClassOf(n) Node.isInterfaceOf(n) Node.isImplementedBy(n) I like Node.has for its succinctness. hasInstance is all right too, but it has the downside of looking like [[HasInstance]] which doesn't handle multiple globals, the thing we're trying to avoid.
Received on Thursday, 21 June 2012 03:20:41 UTC