{"action":"created","issue":{"url":"https://api.github.com/repos/asciidwango/js-primer/issues/112","repository_url":"https://api.github.com/repos/asciidwango/js-primer","labels_url":"https://api.github.com/repos/asciidwango/js-primer/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/asciidwango/js-primer/issues/112/comments","events_url":"https://api.github.com/repos/asciidwango/js-primer/issues/112/events","html_url":"https://github.com/asciidwango/js-primer/issues/112","id":168464740,"number":112,"title":"[meta] function/関数","user":{"login":"azu","id":19714,"avatar_url":"https://avatars.githubusercontent.com/u/19714?v=3","gravatar_id":"","url":"https://api.github.com/users/azu","html_url":"https://github.com/azu","followers_url":"https://api.github.com/users/azu/followers","following_url":"https://api.github.com/users/azu/following{/other_user}","gists_url":"https://api.github.com/users/azu/gists{/gist_id}","starred_url":"https://api.github.com/users/azu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azu/subscriptions","organizations_url":"https://api.github.com/users/azu/orgs","repos_url":"https://api.github.com/users/azu/repos","events_url":"https://api.github.com/users/azu/events{/privacy}","received_events_url":"https://api.github.com/users/azu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/asciidwango/js-primer/labels/meta","name":"meta","color":"f7c6c7"},{"url":"https://api.github.com/repos/asciidwango/js-primer/labels/%E5%9F%BA%E7%A4%8E%E6%96%87%E6%B3%95","name":"基礎文法","color":"1d76db"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-30T12:16:43Z","updated_at":"2016-07-30T14:28:13Z","closed_at":null,"body":"関数についてのメタ的なIssueです\r\n\r\n現在、関数に関連するものは以下のものがあります。\r\n\r\n- 関数宣言、関数式、Arrow Function #20 \r\n- Function/prototype/ブロックスコープ/クロージャー #24 \r\n- class #39 \r\n- Generator (まだIssueがない)\r\n\r\n> JavaScriptでは、これらは関数というひとつの構造の、3種類の利用パターンにすぎない\r\n> -- Effective JavaScript\r\n\r\nES5までは、関数はただの書き方の違いだったが、ES2015からは明確に機能として違いが存在している。\r\n\r\n|                      | Func decl/Func expr | Arrow     | Class       | Method    |\r\n|----------------------|---------------------|-----------|-------------|-----------|\r\n| call-able    | ✔                   | ✔         | ×           | ✔         |\r\n| new-able | ✔                   | ×         | ✔           | ×         |\r\n| Prototype            | Function#           | Function# | Super class | Function# |\r\n| Property prototype   | ✔                   | ×         | ✔           | ×         |\r\n\r\n\r\n|            | Func decl | Func expr | Arrow   | Class | Method |\r\n|------------|-----------|-----------|---------|-------|--------|\r\n| this       | ✔         | ✔         | lexical | ✔     | ✔      |\r\n| new.target | ✔         | ✔         | lexical | ✔     | ✔      |\r\n| super.prop | ×         | ×         | lexical | ✔     | ✔      |\r\n| super()    | ×         | ×         | ×       | ✔     | ×      |\r\n\r\nvia [12. Callable entities in ECMAScript 6](http://exploringjs.com/es6/ch_callables.html#sec_faq-callables \"12. Callable entities in ECMAScript 6\")\r\n\r\nこれによって`new`できるできないや、関数として呼べるかなどの違いが存在している。\r\nまた書き方が色々に存在している。\r\nそのため、関数と一口にまとめるのが難しい機能になってきている。\r\n\r\nこのIssueではどのように分類する(節として分ける)かを決定するまでをやる。"},"comment":{"url":"https://api.github.com/repos/asciidwango/js-primer/issues/comments/236368124","html_url":"https://github.com/asciidwango/js-primer/issues/112#issuecomment-236368124","issue_url":"https://api.github.com/repos/asciidwango/js-primer/issues/112","id":236368124,"user":{"login":"azu","id":19714,"avatar_url":"https://avatars.githubusercontent.com/u/19714?v=3","gravatar_id":"","url":"https://api.github.com/users/azu","html_url":"https://github.com/azu","followers_url":"https://api.github.com/users/azu/followers","following_url":"https://api.github.com/users/azu/following{/other_user}","gists_url":"https://api.github.com/users/azu/gists{/gist_id}","starred_url":"https://api.github.com/users/azu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azu/subscriptions","organizations_url":"https://api.github.com/users/azu/orgs","repos_url":"https://api.github.com/users/azu/repos","events_url":"https://api.github.com/users/azu/events{/privacy}","received_events_url":"https://api.github.com/users/azu/received_events","type":"User","site_admin":false},"created_at":"2016-07-30T14:28:13Z","updated_at":"2016-07-30T14:28:13Z","body":"```js\r\nvar objA = { method(){} };\r\nvar objB = { method: function(){} };\r\nnew objA.method; // NG\r\nnew objB.method;// OK\r\n```\r\n\r\nこれを同じ\"メソッド\"としてまとめていいものなのかなー。\r\n\r\nES2015での`method`は次のような定義になってる\r\n\r\n> method\r\n> function that is the value of a property\r\n> http://www.ecma-international.org/ecma-262/7.0/#sec-method\r\n\r\n[MethodDefinition](http://www.ecma-international.org/ecma-262/7.0/#sec-runtime-semantics-definemethod \"ECMAScript® 2016 Language Specification\")"}}
{"actor":{"display_login":"azu"}}