janl/mustache.js — pull request #305 by danielfagerstrom (2013-03-18 11:54:49+00:00)
Title: Mustache specs - method interpolation compliance

According to the [Mustache spec](http://github.com/mustache/spec/blob/master/specs/interpolation.yml) if the name parts in a doted name refers to methods, these methods should be called in the context of the object they are contained in. In mustache.js only the last name in a doted name is called (if it is a function) and it is called in the context of the current view object rather than in the context of its object.

I try to use mustache.js on nested objects that contain accessor methods and it would be much easier if mustache.js followed the behavior from the spec. And I have therefore implemented that behavior.

If we e.g. have a interpolation ```{{foo.bar}}``` where ```foo``` is a method in the current view that returns a object ```o``` with a ```bar``` method, ```foo``` will be called in the context of the current view and ```bar``` will be called in the context of ```o```.

Unfortunately this change break some current function behavior, I have updated one of the tests and the documentation to reflect this. And provided tests for the new behavior.