It seems that when referring to a property of the Global object from inside a scope other than the global scope, LinkedDescriptor.Get() throws an exception, because it tries to pass the current scope (passed in as the 'that' parameter by the ExecutionVisitor)
to the underlying NativeDescriptor, rather than the actual object that the LinkedDescriptor refers to (its 'targetObject' property). If I change LinkedDescriptor.Get() to call d.Get(targetObject) it works as expected, but perhaps I'm missing something here?
Is ExecutionVisitor doing the wrong thing by passing in CurrentScope to Get()? It could pass in r.targetObject instead, given it knows it has a LinkedDescriptor).
Thanks for any assistance.