{"action":"created","issue":{"url":"https://api.github.com/repos/jshint/jshint/issues/2993","repository_url":"https://api.github.com/repos/jshint/jshint","labels_url":"https://api.github.com/repos/jshint/jshint/issues/2993/labels{/name}","comments_url":"https://api.github.com/repos/jshint/jshint/issues/2993/comments","events_url":"https://api.github.com/repos/jshint/jshint/issues/2993/events","html_url":"https://github.com/jshint/jshint/pull/2993","id":168782337,"number":2993,"title":"[[FIX]] Computed names for object getters and setters","user":{"login":"sstern6","id":10355544,"avatar_url":"https://avatars.githubusercontent.com/u/10355544?v=3","gravatar_id":"","url":"https://api.github.com/users/sstern6","html_url":"https://github.com/sstern6","followers_url":"https://api.github.com/users/sstern6/followers","following_url":"https://api.github.com/users/sstern6/following{/other_user}","gists_url":"https://api.github.com/users/sstern6/gists{/gist_id}","starred_url":"https://api.github.com/users/sstern6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sstern6/subscriptions","organizations_url":"https://api.github.com/users/sstern6/orgs","repos_url":"https://api.github.com/users/sstern6/repos","events_url":"https://api.github.com/users/sstern6/events{/privacy}","received_events_url":"https://api.github.com/users/sstern6/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-08-02T01:55:45Z","updated_at":"2016-09-05T20:35:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jshint/jshint/pulls/2993","html_url":"https://github.com/jshint/jshint/pull/2993","diff_url":"https://github.com/jshint/jshint/pull/2993.diff","patch_url":"https://github.com/jshint/jshint/pull/2993.patch"},"body":"Added logic in src/jshint.js that checks the next value of a getter and/or setter in ES6 so errors will not be thrown if a developer writes getters and/or setters in their JS file, if the next value is an open bracket [, then we assign a variable to the already implemented computedPropertyName, and if thats not the next character we call propertyName(), which was originally the only function call that was being assigned to i.\r\n\r\nThis issue fixes https://github.com/jshint/jshint/issues/2871"},"comment":{"url":"https://api.github.com/repos/jshint/jshint/issues/comments/244808730","html_url":"https://github.com/jshint/jshint/pull/2993#issuecomment-244808730","issue_url":"https://api.github.com/repos/jshint/jshint/issues/2993","id":244808730,"user":{"login":"sstern6","id":10355544,"avatar_url":"https://avatars.githubusercontent.com/u/10355544?v=3","gravatar_id":"","url":"https://api.github.com/users/sstern6","html_url":"https://github.com/sstern6","followers_url":"https://api.github.com/users/sstern6/followers","following_url":"https://api.github.com/users/sstern6/following{/other_user}","gists_url":"https://api.github.com/users/sstern6/gists{/gist_id}","starred_url":"https://api.github.com/users/sstern6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sstern6/subscriptions","organizations_url":"https://api.github.com/users/sstern6/orgs","repos_url":"https://api.github.com/users/sstern6/repos","events_url":"https://api.github.com/users/sstern6/events{/privacy}","received_events_url":"https://api.github.com/users/sstern6/received_events","type":"User","site_admin":false},"created_at":"2016-09-05T20:35:42Z","updated_at":"2016-09-05T20:35:42Z","body":"@jugglinmike updated with most recent changes, comments, member support, and testing.  In my PR, on line 4923, I checked if the type of value is not a string and then, assigned `value = null`.  But given the example and issue:\r\n\r\n```\r\n({\r\n  get [1 + 2]() {},\r\n  get '+'() {}\r\n});\r\n```\r\nI checked if `value.left && value.right` exist, and then if those values are not strings, then reassign `value.value` to be the combination of `value.left` and `value.right` because the evaluated expression should be compared, not the individual parts of the expression.  This feels a little hacky but the only way I could see solving this issue without touching other methods.  That being said, if we check, and where I got my inspiration from:\r\n\r\n```\r\n({\r\n  get [\"1\" + \"2\"]() {}\r\n})\r\n```\r\n\r\n`Value` does not have a left and a right property when checking value in `computedPropertyName`, this means somewhere in the code, it is seeing that this string is an expression and adds the values.  This looks like it could be happening in `advance` or `expression`.\r\n\r\nThat being said, i dont know if its wise to allow users to have numbers or numeric string values as getter or setter properties without a warning or error.  Per the MDN documentation, it seems like the only values given as examples are strings with chars `a-z || A-Z`.\r\n\r\nPlease let me know your thoughts on the PR and if you have any feedback on the implementation, tests, or JSDoc comments.\r\n\r\nThank you!\r\n"}}
{"actor":{"display_login":"sstern6"}}