{"action":"created","issue":{"url":"https://api.github.com/repos/mochajs/mocha/issues/2548","repository_url":"https://api.github.com/repos/mochajs/mocha","labels_url":"https://api.github.com/repos/mochajs/mocha/issues/2548/labels{/name}","comments_url":"https://api.github.com/repos/mochajs/mocha/issues/2548/comments","events_url":"https://api.github.com/repos/mochajs/mocha/issues/2548/events","html_url":"https://github.com/mochajs/mocha/issues/2548","id":184084680,"number":2548,"title":"Explodes on ES6 default parameters","user":{"login":"Cazra","id":974610,"avatar_url":"https://avatars.githubusercontent.com/u/974610?v=3","gravatar_id":"","url":"https://api.github.com/users/Cazra","html_url":"https://github.com/Cazra","followers_url":"https://api.github.com/users/Cazra/followers","following_url":"https://api.github.com/users/Cazra/following{/other_user}","gists_url":"https://api.github.com/users/Cazra/gists{/gist_id}","starred_url":"https://api.github.com/users/Cazra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cazra/subscriptions","organizations_url":"https://api.github.com/users/Cazra/orgs","repos_url":"https://api.github.com/users/Cazra/repos","events_url":"https://api.github.com/users/Cazra/events{/privacy}","received_events_url":"https://api.github.com/users/Cazra/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-19T21:56:46Z","updated_at":"2016-10-22T18:05:53Z","closed_at":"2016-10-22T18:05:53Z","body":"Mocha is having trouble when it encounters ES6 default parameters being given to functions, even if it is encountered in a depency node module. \r\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters\r\n\r\nE.g.:\r\n\r\n```\r\nconstructor(name, hostname='localhost') {\r\n    this._name = name;\r\n    this._hostname = hostname;\r\n    this._openChannels = {};\r\n}\r\n```\r\n\r\nIn the console, it gives a message like this:\r\n\r\n```\r\n/path/to/src/index.js:44\r\n  constructor(name, hostname='localhost') {\r\n                            ^\r\n\r\nSyntaxError: Unexpected token =\r\n    at exports.runInThisContext (vm.js:53:16)\r\n    at Module._compile (module.js:413:25)\r\n    at Object.Module._extensions..js (module.js:452:10)\r\n    at Module.load (module.js:355:32)\r\n    at Function.Module._load (module.js:310:12)\r\n    at Module.require (module.js:365:17)\r\n    at require (module.js:384:17)\r\n...\r\n```"},"comment":{"url":"https://api.github.com/repos/mochajs/mocha/issues/comments/255544107","html_url":"https://github.com/mochajs/mocha/issues/2548#issuecomment-255544107","issue_url":"https://api.github.com/repos/mochajs/mocha/issues/2548","id":255544107,"user":{"login":"ScottFreeCode","id":16506071,"avatar_url":"https://avatars.githubusercontent.com/u/16506071?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottFreeCode","html_url":"https://github.com/ScottFreeCode","followers_url":"https://api.github.com/users/ScottFreeCode/followers","following_url":"https://api.github.com/users/ScottFreeCode/following{/other_user}","gists_url":"https://api.github.com/users/ScottFreeCode/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottFreeCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottFreeCode/subscriptions","organizations_url":"https://api.github.com/users/ScottFreeCode/orgs","repos_url":"https://api.github.com/users/ScottFreeCode/repos","events_url":"https://api.github.com/users/ScottFreeCode/events{/privacy}","received_events_url":"https://api.github.com/users/ScottFreeCode/received_events","type":"User","site_admin":false},"created_at":"2016-10-22T18:05:53Z","updated_at":"2016-10-22T18:05:53Z","body":"Looks like this was only added in Node 6: http://node.green/#default-function-parameters\r\n\r\nYou can also confirm this by trying using a function with default parameters in Node outside of Mocha, I think; let me know if it does work there after all and I'll help dig into it further."}}
{"actor":{"display_login":"ScottFreeCode"}}