{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/12956","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/12956/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/12956/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/12956/events","html_url":"https://github.com/nodejs/node/issues/12956","id":227854173,"number":12956,"title":"Don't use userobject.call/userobject.apply","user":{"login":"daurnimator","id":127971,"avatar_url":"https://avatars2.githubusercontent.com/u/127971?v=3","gravatar_id":"","url":"https://api.github.com/users/daurnimator","html_url":"https://github.com/daurnimator","followers_url":"https://api.github.com/users/daurnimator/followers","following_url":"https://api.github.com/users/daurnimator/following{/other_user}","gists_url":"https://api.github.com/users/daurnimator/gists{/gist_id}","starred_url":"https://api.github.com/users/daurnimator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daurnimator/subscriptions","organizations_url":"https://api.github.com/users/daurnimator/orgs","repos_url":"https://api.github.com/users/daurnimator/repos","events_url":"https://api.github.com/users/daurnimator/events{/privacy}","received_events_url":"https://api.github.com/users/daurnimator/received_events","type":"User","site_admin":false},"labels":[{"id":151728680,"url":"https://api.github.com/repos/nodejs/node/labels/wontfix","name":"wontfix","color":"ededed","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-05-11T01:29:04Z","updated_at":"2017-05-11T02:41:27Z","closed_at":"2017-05-11T02:16:15Z","body":"* **Version**: v7.9.0\r\n\r\n<!-- Enter your issue details below this comment. -->\r\n\r\nInternally node shouldn't rely on user provided functions/objects having 'normal' values.\r\n\r\ne.g.\r\n\r\n```js\r\na = function() { console.log(1,2,3)};\r\na.call = \"some value\"\r\nsetTimeout(a, 100); true\r\n```\r\nOutput:\r\n```\r\nTypeError: callback.call is not a function\r\n    at ontimeout (timers.js:386:14)\r\n    at tryOnTimeout (timers.js:250:5)\r\n    at Timer.listOnTimeout (timers.js:214:5)\r\n```\r\nFor this example, node's timers.js should be using `Function.prototype.call` or [`Reflect.apply`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/apply)"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/300666966","html_url":"https://github.com/nodejs/node/issues/12956#issuecomment-300666966","issue_url":"https://api.github.com/repos/nodejs/node/issues/12956","id":300666966,"user":{"login":"refack","id":96947,"avatar_url":"https://avatars0.githubusercontent.com/u/96947?v=3","gravatar_id":"","url":"https://api.github.com/users/refack","html_url":"https://github.com/refack","followers_url":"https://api.github.com/users/refack/followers","following_url":"https://api.github.com/users/refack/following{/other_user}","gists_url":"https://api.github.com/users/refack/gists{/gist_id}","starred_url":"https://api.github.com/users/refack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refack/subscriptions","organizations_url":"https://api.github.com/users/refack/orgs","repos_url":"https://api.github.com/users/refack/repos","events_url":"https://api.github.com/users/refack/events{/privacy}","received_events_url":"https://api.github.com/users/refack/received_events","type":"User","site_admin":false},"created_at":"2017-05-11T02:41:27Z","updated_at":"2017-05-11T02:41:27Z","body":"@daurnimator note that in all cases IMHO node did what you asked it to do, and most importantly did not crash. It provided you with a proper Error with a stack trace.\r\n\r\nWe can argue the trade-offs in the implementation of the 'util' module (i.e. _printing/inspecting_) it is a `node` module that is not part of the standards, and indeed has it's limitations. For example `Reflect.apply` is a new language construct, and is not yet optimized for performance, so we did not refactor our code to use it (where appropriate).\r\nWe also try not to \"break\" the status-quo unless there is a very compelling reason, since what you consider a bug, other have come to rely upon as expected behaviour, and us changing that behaviour might bring more harm than good in the wider scope of the entire ecosystem."}}
{"actor":{"display_login":"refack"}}