{"action":"created","issue":{"url":"https://api.github.com/repos/atom/electron/issues/4066","labels_url":"https://api.github.com/repos/atom/electron/issues/4066/labels{/name}","comments_url":"https://api.github.com/repos/atom/electron/issues/4066/comments","events_url":"https://api.github.com/repos/atom/electron/issues/4066/events","html_url":"https://github.com/atom/electron/issues/4066","id":126118388,"number":4066,"title":"Remote method call to object instantiated from ES6 style class is not quite working","user":{"login":"jiaz","id":610679,"avatar_url":"https://avatars.githubusercontent.com/u/610679?v=3","gravatar_id":"","url":"https://api.github.com/users/jiaz","html_url":"https://github.com/jiaz","followers_url":"https://api.github.com/users/jiaz/followers","following_url":"https://api.github.com/users/jiaz/following{/other_user}","gists_url":"https://api.github.com/users/jiaz/gists{/gist_id}","starred_url":"https://api.github.com/users/jiaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiaz/subscriptions","organizations_url":"https://api.github.com/users/jiaz/orgs","repos_url":"https://api.github.com/users/jiaz/repos","events_url":"https://api.github.com/users/jiaz/events{/privacy}","received_events_url":"https://api.github.com/users/jiaz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/atom/electron/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-12T07:43:09Z","updated_at":"2016-01-12T10:35:15Z","closed_at":null,"body":"ES6 classes treat member functions as non-enumerable in the instantiated class. However remote currently only works with enumerable properties, which means I have to use the old school prototype style to define classes for remote use. I find it a little bit inconvenient.\r\n\r\nHere is an example:\r\n\r\nin main process\r\n```\r\nclass ClientSocket {\r\n    connect() {\r\n        //..\r\n    }\r\n}\r\napp.clientSocket = new ClientSocket();\r\n```\r\n\r\nin render process\r\n```\r\nconst clientSocket = remote.app.clientSocket;\r\nclientSocket.connect() // this doesn't work because connect() is not enumerable.\r\n```\r\n\r\nI mostly write new code in ES6 style and I'd like to keep my code style consistent. Is there any way to enable remote for ES6 class?\r\n"},"comment":{"url":"https://api.github.com/repos/atom/electron/issues/comments/170869072","html_url":"https://github.com/atom/electron/issues/4066#issuecomment-170869072","issue_url":"https://api.github.com/repos/atom/electron/issues/4066","id":170869072,"user":{"login":"zcbenz","id":639601,"avatar_url":"https://avatars.githubusercontent.com/u/639601?v=3","gravatar_id":"","url":"https://api.github.com/users/zcbenz","html_url":"https://github.com/zcbenz","followers_url":"https://api.github.com/users/zcbenz/followers","following_url":"https://api.github.com/users/zcbenz/following{/other_user}","gists_url":"https://api.github.com/users/zcbenz/gists{/gist_id}","starred_url":"https://api.github.com/users/zcbenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcbenz/subscriptions","organizations_url":"https://api.github.com/users/zcbenz/orgs","repos_url":"https://api.github.com/users/zcbenz/repos","events_url":"https://api.github.com/users/zcbenz/events{/privacy}","received_events_url":"https://api.github.com/users/zcbenz/received_events","type":"User","site_admin":true},"created_at":"2016-01-12T10:35:15Z","updated_at":"2016-01-12T10:35:15Z","body":"It is quite a surprise to me that ES6 class methods are not enumerable."}}