{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/6792","repository_url":"https://api.github.com/repos/babel/babel","labels_url":"https://api.github.com/repos/babel/babel/issues/6792/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/6792/comments","events_url":"https://api.github.com/repos/babel/babel/issues/6792/events","html_url":"https://github.com/babel/babel/pull/6792","id":273000483,"number":6792,"title":"Do not access out of bounds arguments","user":{"login":"apapirovski","id":20809,"avatar_url":"https://avatars2.githubusercontent.com/u/20809?v=4","gravatar_id":"","url":"https://api.github.com/users/apapirovski","html_url":"https://github.com/apapirovski","followers_url":"https://api.github.com/users/apapirovski/followers","following_url":"https://api.github.com/users/apapirovski/following{/other_user}","gists_url":"https://api.github.com/users/apapirovski/gists{/gist_id}","starred_url":"https://api.github.com/users/apapirovski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apapirovski/subscriptions","organizations_url":"https://api.github.com/users/apapirovski/orgs","repos_url":"https://api.github.com/users/apapirovski/repos","events_url":"https://api.github.com/users/apapirovski/events{/privacy}","received_events_url":"https://api.github.com/users/apapirovski/received_events","type":"User","site_admin":false},"labels":[{"id":180608283,"url":"https://api.github.com/repos/babel/babel/labels/area:%20perf","name":"area: perf","color":"c5def5","default":false},{"id":311566331,"url":"https://api.github.com/repos/babel/babel/labels/PR:%20Polish","name":"PR: Polish","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-11-10T17:11:03Z","updated_at":"2017-12-03T11:24:11Z","closed_at":"2017-11-17T20:39:08Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/babel/babel/pulls/6792","html_url":"https://github.com/babel/babel/pull/6792","diff_url":"https://github.com/babel/babel/pull/6792.diff","patch_url":"https://github.com/babel/babel/pull/6792.patch"},"body":"<!--\r\nBefore making a PR please make sure to read our contributing guidelines\r\nhttps://github.com/babel/babel/blob/master/CONTRIBUTING.md\r\n\r\nFor issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. It should be underlined in the preview if done correctly.\r\n-->\r\n\r\n| Q                        | A <!--(Can use an emoji 👍) -->\r\n| ------------------------ | ---\r\n| Fixed Issues?            | \r\n| Patch: Bug Fix?          | Yes?\r\n| Major: Breaking Change?  | No\r\n| Minor: New Feature?      | No\r\n| Tests Added + Pass?      | Yes\r\n| Documentation PR         | No <!-- If so, add `[skip ci]` to your commit message to skip CI -->\r\n| Any Dependency Changes?  | No\r\n| License                  | MIT\r\n\r\n<!-- Describe your changes below in as much detail as possible -->\r\nIn `babel-plugin-transform-parameters`, potentially out of bounds arguments should not just be directly accessed, instead use a ternary operator to check length. Accessing out of bounds is expensive ~~and means that engines are unable to optimize the function~~.\r\n\r\n(A plain benchmark on accessing out of bounds arguments shows about 5x slower execution for a basic function that literally just accesses a single argument.)"},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/348757274","html_url":"https://github.com/babel/babel/pull/6792#issuecomment-348757274","issue_url":"https://api.github.com/repos/babel/babel/issues/6792","id":348757274,"user":{"login":"blikblum","id":3047126,"avatar_url":"https://avatars0.githubusercontent.com/u/3047126?v=4","gravatar_id":"","url":"https://api.github.com/users/blikblum","html_url":"https://github.com/blikblum","followers_url":"https://api.github.com/users/blikblum/followers","following_url":"https://api.github.com/users/blikblum/following{/other_user}","gists_url":"https://api.github.com/users/blikblum/gists{/gist_id}","starred_url":"https://api.github.com/users/blikblum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blikblum/subscriptions","organizations_url":"https://api.github.com/users/blikblum/orgs","repos_url":"https://api.github.com/users/blikblum/repos","events_url":"https://api.github.com/users/blikblum/events{/privacy}","received_events_url":"https://api.github.com/users/blikblum/received_events","type":"User","site_admin":false},"created_at":"2017-12-03T11:24:11Z","updated_at":"2017-12-03T11:24:11Z","author_association":"NONE","body":"> (A plain benchmark on accessing out of bounds arguments shows about 5x slower execution for a basic function that literally just accesses a single argument.)\r\n\r\n@apapirovski \r\nThe benchmark is public?\r\n\r\n@bmeurer \r\nThe overhead occurs only with function arguments or also affects normal arrays?\r\n\r\nIn #6582 and #6580 the offending index is a not valid array index (-1). Here the array index is a valid one (positive integer). \r\n\r\nDoes accessing an array with an out of bounds index, even if a valid one, gives the same behavior as accessing an array with an invalid index?"}}
{"actor":{"display_login":"blikblum"}}