{"action":"created","issue":{"url":"https://api.github.com/repos/sveltejs/svelte/issues/179","repository_url":"https://api.github.com/repos/sveltejs/svelte","labels_url":"https://api.github.com/repos/sveltejs/svelte/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/sveltejs/svelte/issues/179/comments","events_url":"https://api.github.com/repos/sveltejs/svelte/issues/179/events","html_url":"https://github.com/sveltejs/svelte/issues/179","id":194813143,"number":179,"title":"How to set/get data within custom method? (this.set/get not working)","user":{"login":"rgeraldporter","id":955052,"avatar_url":"https://avatars.githubusercontent.com/u/955052?v=3","gravatar_id":"","url":"https://api.github.com/users/rgeraldporter","html_url":"https://github.com/rgeraldporter","followers_url":"https://api.github.com/users/rgeraldporter/followers","following_url":"https://api.github.com/users/rgeraldporter/following{/other_user}","gists_url":"https://api.github.com/users/rgeraldporter/gists{/gist_id}","starred_url":"https://api.github.com/users/rgeraldporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgeraldporter/subscriptions","organizations_url":"https://api.github.com/users/rgeraldporter/orgs","repos_url":"https://api.github.com/users/rgeraldporter/repos","events_url":"https://api.github.com/users/rgeraldporter/events{/privacy}","received_events_url":"https://api.github.com/users/rgeraldporter/received_events","type":"User","site_admin":false},"labels":[{"id":485407406,"url":"https://api.github.com/repos/sveltejs/svelte/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-11T04:58:05Z","updated_at":"2016-12-11T15:16:13Z","closed_at":null,"body":"Not sure if this is a bug or I'm doing it wrong, but `this.set` and `this.get` within a custom method do not appear to work. Or am I doing this wrong?\r\n\r\ne.g., the following doesn't work in REPL\r\n\r\n```\r\n<h1>Hello {{name1}}!</h1>\r\n<h1>Hello {{name2}}!</h1>\r\n<button on:click='swap()'>Swap!</button>\r\n\r\n<script>\r\n    export default {\r\n        data () {\r\n            return {\r\n                name1: 'Joe',\r\n              \tname2: 'Bob'\r\n            }\r\n        },\r\n        methods: {\r\n            swap: () => {\r\n                let nameA = this.get('name1');\r\n              \tlet nameB = this.get('name2');\r\n              \tthis.set({name1: nameB, name2: nameA});\r\n            }\r\n        }\r\n    }\r\n</script>\r\n```"},"comment":{"url":"https://api.github.com/repos/sveltejs/svelte/issues/comments/266287742","html_url":"https://github.com/sveltejs/svelte/issues/179#issuecomment-266287742","issue_url":"https://api.github.com/repos/sveltejs/svelte/issues/179","id":266287742,"user":{"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},"created_at":"2016-12-11T15:16:13Z","updated_at":"2016-12-11T15:16:13Z","body":"Actually, we can improve on that – if the arrow function expression doesn't use `this` or `arguments`, no problem. If it does, error."}}
{"actor":{"display_login":"Rich-Harris"}}