dart-lang/js-interop — pull request #33 by sbermeister (2012-12-13 23:51:46+00:00)
Title: New Proxy.callMethod for dynamically named function calls

I added the callMethod function to Proxy objects, as there is currently no way of calling a function with an arbitrary name on Javascript objects.

For example, the following would work:
```
js.context.console.log('hi!');
```

But these examples would not work:
```
js.context.console['log']('hi!');
```
```
var x = js.context.console.log
x('hi!');
```

This is because the Function object detaches from its parent object when it is called. I believe this is caused from this TODO: [master/lib/dart_interop.js#L148](https://github.com/dart-lang/js-interop/blob/master/lib/dart_interop.js#L148)

The callMethod function is a temporary solution that allows chaining the [] and call operators. In future, we can return a wrapped object from [] that has an appropriate call method which remembers its parent.

Thanks,

Sasha