{"action":"created","issue":{"url":"https://api.github.com/repos/tc39/Function-prototype-toString-revision/issues/20","repository_url":"https://api.github.com/repos/tc39/Function-prototype-toString-revision","labels_url":"https://api.github.com/repos/tc39/Function-prototype-toString-revision/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/tc39/Function-prototype-toString-revision/issues/20/comments","events_url":"https://api.github.com/repos/tc39/Function-prototype-toString-revision/issues/20/events","html_url":"https://github.com/tc39/Function-prototype-toString-revision/issues/20","id":189307038,"number":20,"title":"toString result in CreateDynamicFunction doesn't match to existing implementations","user":{"login":"arai-a","id":6299746,"avatar_url":"https://avatars.githubusercontent.com/u/6299746?v=3","gravatar_id":"","url":"https://api.github.com/users/arai-a","html_url":"https://github.com/arai-a","followers_url":"https://api.github.com/users/arai-a/followers","following_url":"https://api.github.com/users/arai-a/following{/other_user}","gists_url":"https://api.github.com/users/arai-a/gists{/gist_id}","starred_url":"https://api.github.com/users/arai-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arai-a/subscriptions","organizations_url":"https://api.github.com/users/arai-a/orgs","repos_url":"https://api.github.com/users/arai-a/repos","events_url":"https://api.github.com/users/arai-a/events{/privacy}","received_events_url":"https://api.github.com/users/arai-a/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-15T06:02:39Z","updated_at":"2016-12-01T01:08:18Z","closed_at":null,"body":"With the proposal, `Function(\"a\", \"b\", \"c\").toString()` generates the following string:\r\n```\r\nfunction anonymous(a,b\r\n) {c\r\n}\r\n```\r\n\r\nbut it doesn't match to existing implementations.\r\n\r\nFirefox\r\n```\r\nfunction anonymous(a, b) {\r\nc\r\n}\r\n```\r\n\r\nChrome\r\n```\r\nfunction anonymous(a,b\r\n/**/) {\r\nc\r\n}\r\n```\r\n\r\nSafari\r\n```\r\nfunction anonymous(a, b) {\r\nc\r\n}\r\n```\r\n\r\nEdge\r\n```\r\nfunction anonymous(a,b) {\r\nc\r\n}\r\n```\r\n\r\nSo, the main differences are:\r\n  * LF before body is removed in the proposal\r\n  * LF after parameters is added in the proposal, except Chrome\r\n\r\nQuestion 1.\r\nIs there any good reason to remove LF before body?\r\nputting LF there should give us better string representation, and matches to existing implementations.\r\n\r\nQuestion 2.\r\nAbout LF after parameters, If I understand correctly, it's there to make toString result not SyntaxError when parameter contains \"//\".  But it's necessary only in the case.\r\nHow about putting LF only if necessary? (it will introduce additional complexity tho...)\r\n"},"comment":{"url":"https://api.github.com/repos/tc39/Function-prototype-toString-revision/issues/comments/264048228","html_url":"https://github.com/tc39/Function-prototype-toString-revision/issues/20#issuecomment-264048228","issue_url":"https://api.github.com/repos/tc39/Function-prototype-toString-revision/issues/20","id":264048228,"user":{"login":"arai-a","id":6299746,"avatar_url":"https://avatars.githubusercontent.com/u/6299746?v=3","gravatar_id":"","url":"https://api.github.com/users/arai-a","html_url":"https://github.com/arai-a","followers_url":"https://api.github.com/users/arai-a/followers","following_url":"https://api.github.com/users/arai-a/following{/other_user}","gists_url":"https://api.github.com/users/arai-a/gists{/gist_id}","starred_url":"https://api.github.com/users/arai-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arai-a/subscriptions","organizations_url":"https://api.github.com/users/arai-a/orgs","repos_url":"https://api.github.com/users/arai-a/repos","events_url":"https://api.github.com/users/arai-a/events{/privacy}","received_events_url":"https://api.github.com/users/arai-a/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T01:08:18Z","updated_at":"2016-12-01T01:08:18Z","body":"related issue around comment and toString, from https://bugzilla.mozilla.org/show_bug.cgi?id=1317400#c3\r\n\r\n> It's probably worth noting that the proposal only handles trailing\r\n> single-line comments (by adding U+000A (LINE FEED) after the parameters and\r\n> body string), but it doesn't handle leading html-comments.\r\n> \r\n> Per the current proposal\r\n> ```\r\n> Function(\"-->\").toString() === \"function anonymous(\\n) {-->\\n}\"\r\n> \r\n> Function(\"-->\", \"\").toString() === \"function anonymous(-->\\n) {\\n}\r\n> ```\r\n> \r\n> If we want to keep `eval(functionObj.toString())` working for these cases,\r\n> we also need to emit a line terminator before the parameters and body\r\n> strings.\r\n"}}
{"actor":{"display_login":"arai-a"}}