DynamoDS/Dynamo — pull request #2164 by ke-yu (2014-08-15 05:43:34+00:00)
Title: Fix functionobject

This pull request is to fix two test cases related to function object: TestSortByKey() and TestCompose03().

There are couples of problems:
* In FunctionObject.ds, we don't check the count of list is 0 or not. Range expression ``0..(count-1)`` will generates ``{0, -1}`` instead of an empty list if ``count`` is 0, therefore the following for loop iteration will get an "Array is overindexed'' error.
* Call site instance is not updated in normal execution mode. That means method resolution may potentially fail for case like ``foo.Bar()`` if ``Bar()`` is overloaded in derive class. We need to update call site instance always.
* In some cases FFI will try to marshal a StackValue to a StackValue and in this process the meta type information may be removed. A function ``MarshalToStackValue()`` is added to handle this case so that the meta type information will be reserved.