{"action":"created","issue":{"url":"https://api.github.com/repos/ractivejs/ractive/issues/2224","labels_url":"https://api.github.com/repos/ractivejs/ractive/issues/2224/labels{/name}","comments_url":"https://api.github.com/repos/ractivejs/ractive/issues/2224/comments","events_url":"https://api.github.com/repos/ractivejs/ractive/issues/2224/events","html_url":"https://github.com/ractivejs/ractive/issues/2224","id":111710771,"number":2224,"title":"Unexpected function call (in partial context)","user":{"login":"woodlandhunter","id":6824706,"avatar_url":"https://avatars.githubusercontent.com/u/6824706?v=3","gravatar_id":"","url":"https://api.github.com/users/woodlandhunter","html_url":"https://github.com/woodlandhunter","followers_url":"https://api.github.com/users/woodlandhunter/followers","following_url":"https://api.github.com/users/woodlandhunter/following{/other_user}","gists_url":"https://api.github.com/users/woodlandhunter/gists{/gist_id}","starred_url":"https://api.github.com/users/woodlandhunter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woodlandhunter/subscriptions","organizations_url":"https://api.github.com/users/woodlandhunter/orgs","repos_url":"https://api.github.com/users/woodlandhunter/repos","events_url":"https://api.github.com/users/woodlandhunter/events{/privacy}","received_events_url":"https://api.github.com/users/woodlandhunter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ractivejs/ractive/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ractivejs/ractive/milestones/14","html_url":"https://github.com/ractivejs/ractive/milestones/0.8","labels_url":"https://api.github.com/repos/ractivejs/ractive/milestones/14/labels","id":1032288,"number":14,"title":"0.8","description":"","creator":{"login":"Rich-Harris","id":1162160,"avatar_url":"https://avatars.githubusercontent.com/u/1162160?v=3","gravatar_id":"","url":"https://api.github.com/users/Rich-Harris","html_url":"https://github.com/Rich-Harris","followers_url":"https://api.github.com/users/Rich-Harris/followers","following_url":"https://api.github.com/users/Rich-Harris/following{/other_user}","gists_url":"https://api.github.com/users/Rich-Harris/gists{/gist_id}","starred_url":"https://api.github.com/users/Rich-Harris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rich-Harris/subscriptions","organizations_url":"https://api.github.com/users/Rich-Harris/orgs","repos_url":"https://api.github.com/users/Rich-Harris/repos","events_url":"https://api.github.com/users/Rich-Harris/events{/privacy}","received_events_url":"https://api.github.com/users/Rich-Harris/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":41,"state":"open","created_at":"2015-03-21T18:36:18Z","updated_at":"2015-11-02T01:32:33Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-10-15T21:25:13Z","updated_at":"2015-11-02T11:32:38Z","closed_at":null,"body":"See the attached fiddle. `someFunc` is called (with undefined as the argument) when `foo` is set to `null`\r\n\r\nhttp://jsfiddle.net/j3mjdf0m/"},"comment":{"url":"https://api.github.com/repos/ractivejs/ractive/issues/comments/152994206","html_url":"https://github.com/ractivejs/ractive/issues/2224#issuecomment-152994206","issue_url":"https://api.github.com/repos/ractivejs/ractive/issues/2224","id":152994206,"user":{"login":"evs-chris","id":161978,"avatar_url":"https://avatars.githubusercontent.com/u/161978?v=3","gravatar_id":"","url":"https://api.github.com/users/evs-chris","html_url":"https://github.com/evs-chris","followers_url":"https://api.github.com/users/evs-chris/followers","following_url":"https://api.github.com/users/evs-chris/following{/other_user}","gists_url":"https://api.github.com/users/evs-chris/gists{/gist_id}","starred_url":"https://api.github.com/users/evs-chris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evs-chris/subscriptions","organizations_url":"https://api.github.com/users/evs-chris/orgs","repos_url":"https://api.github.com/users/evs-chris/repos","events_url":"https://api.github.com/users/evs-chris/events{/privacy}","received_events_url":"https://api.github.com/users/evs-chris/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T11:32:38Z","updated_at":"2015-11-02T11:32:38Z","body":"Looks like the partial with context bit can be more-or-less fixed, but since it's just a `{{#with}}` wrapped around the partial, any other unresolved inside a side-effecting `{{#with}}` is going to have the same issue.\r\n\r\nIt looks like if we made the expression proxy aware of its rendered state somehow, we could avoid the recomputation since it should go out of scope with the wrapping conditional. I didn't see a quick and easy way to do so though, since those are a sort of hybrid model fragment beastie. My inner-functional-snob say just don't side-effect like that :smile:\r\n\r\nAt any rate...\r\n\r\n```diff\r\ndiff --git a/src/view/items/Partial.js b/src/view/items/Partial.js\r\nindex b4b4eaf..7c6371e 100644\r\n--- a/src/view/items/Partial.js\r\n+++ b/src/view/items/Partial.js\r\n@@ -5,8 +5,6 @@ import getPartialTemplate from './partial/getPartialTemplate';\r\n\r\n export default class Partial extends Mustache {\r\n        bind () {\r\n-               super.bind();\r\n-\r\n                // keep track of the reference name for future resets\r\n                this.refName = this.template.r;\r\n\r\n@@ -16,10 +14,13 @@ export default class Partial extends Mustache {\r\n                if ( template ) {\r\n                        this.named = true;\r\n                        this.setTemplate( this.template.r, template );\r\n-               } else if ( ( !this.model || typeof this.model.get() !== 'string' ) && this.refName ) {\r\n-                       this.setTemplate( this.refName, template );\r\n                } else {\r\n-                       this.setTemplate( this.model.get() );\r\n+                       super.bind();\r\n+                       if ( ( !this.model || typeof this.model.get() !== 'string' ) && this.refName ) {\r\n+                               this.setTemplate( this.refName, template );\r\n+                       } else {\r\n+                               this.setTemplate( this.model.get() );\r\n+                       }\r\n                }\r\n\r\n                this.fragment = new Fragment({\r\n```"}}