Quite a while back I said that I'd write a post describing why we invented IDispatchEx. I already covered the part about using it to probe the stack for security reasons, but what other reasons did we implement that thing? The documentation is pretty much accurate, but sparse in places. (According to the doc, GetNameSpaceParent, uh, gets the namespace parent
Expando objects
In most objects, the methods you've got are the ones you get. But JScript objects and some IE DOM objects can have arbitrary, user-defined properties and methods added to them at will. We call such objects "expando" objects.
Strictly speaking,
Use the
Delete members
JScript has a
Case sensitivity
Visual Basic is case-insensitive, and
Property enumeration
In the non-expando world, the property set of an object is stable, so there's little need to enumerate it. If you did need to enumerate it, you could always just look at the static typeinfo. But constructing dynamic typeinfos in a world with expando objects is difficult and expensive, so instead we added the ability to enumerate the valid dispatch identifiers (
Constructors
JScript functions may be called as constructors, which is a little weird and has
Namespace chaining
JScript supports some pretty intense scope resolution semantics, well beyond the local/class/global
To make the
Debugger support
Finally
So there you go -- a whole lot of new features that were difficult to shoehorn into