QI is just a clunky, '90s version of dynamic_cast with RTTI (even now, RTTI costs too much for us to turn on, at least on some platforms).

What's the rustic way to reflect on types at runtime to do something akin to dynamic_cast?

/be

Josh Matthews <mailto:j...@joshmatthews.net>
August 30, 2013 8:55 PM
The current DOM bindings can only fallibly unwrap object types that have complete WebIDL prototype chains (ie. we can grab the interface ID array from the object and compare the slot in the chain we care about with the one we're trying to unwrap). This causes a problem for things like WindowProxy, which aren't supposed to have an interface, and thus no ID to compare against. In Gecko, we're able to use QueryInterface to determine whether the nsISupports-based object being unwrapped supports the interface we're trying to unwrap to (nsIDOMWindow), but we don't have anything like that in Servo yet. Any suggestions for what to do here? Do I need to bite the bullet and implement something analogous to QueryInterface?

Cheers,
Josh
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to