{"action":"created","issue":{"url":"https://api.github.com/repos/nodeca/argparse/issues/89","labels_url":"https://api.github.com/repos/nodeca/argparse/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/nodeca/argparse/issues/89/comments","events_url":"https://api.github.com/repos/nodeca/argparse/issues/89/events","html_url":"https://github.com/nodeca/argparse/issues/89","id":123883716,"number":89,"title":"Undefined context","user":{"login":"monolithed","id":803674,"avatar_url":"https://avatars.githubusercontent.com/u/803674?v=3","gravatar_id":"","url":"https://api.github.com/users/monolithed","html_url":"https://github.com/monolithed","followers_url":"https://api.github.com/users/monolithed/followers","following_url":"https://api.github.com/users/monolithed/following{/other_user}","gists_url":"https://api.github.com/users/monolithed/gists{/gist_id}","starred_url":"https://api.github.com/users/monolithed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monolithed/subscriptions","organizations_url":"https://api.github.com/users/monolithed/orgs","repos_url":"https://api.github.com/users/monolithed/repos","events_url":"https://api.github.com/users/monolithed/events{/privacy}","received_events_url":"https://api.github.com/users/monolithed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-25T14:20:02Z","updated_at":"2015-12-25T14:45:47Z","closed_at":null,"body":"```js\r\nparser.addArgument(['-t', '--type'], {\r\n\tdefaultValue: 'regular',\r\n\r\n\ttype (value) {\r\n\t\tconsole.log(this) // undefined\r\n\t},\r\n\r\n\thelp: 'Account type can be [regular | pdd | external]'\r\n});\r\n```\r\n\r\nWhy `this` is undefined?"},"comment":{"url":"https://api.github.com/repos/nodeca/argparse/issues/comments/167243056","html_url":"https://github.com/nodeca/argparse/issues/89#issuecomment-167243056","issue_url":"https://api.github.com/repos/nodeca/argparse/issues/89","id":167243056,"user":{"login":"monolithed","id":803674,"avatar_url":"https://avatars.githubusercontent.com/u/803674?v=3","gravatar_id":"","url":"https://api.github.com/users/monolithed","html_url":"https://github.com/monolithed","followers_url":"https://api.github.com/users/monolithed/followers","following_url":"https://api.github.com/users/monolithed/following{/other_user}","gists_url":"https://api.github.com/users/monolithed/gists{/gist_id}","starred_url":"https://api.github.com/users/monolithed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monolithed/subscriptions","organizations_url":"https://api.github.com/users/monolithed/orgs","repos_url":"https://api.github.com/users/monolithed/repos","events_url":"https://api.github.com/users/monolithed/events{/privacy}","received_events_url":"https://api.github.com/users/monolithed/received_events","type":"User","site_admin":false},"created_at":"2015-12-25T14:45:47Z","updated_at":"2015-12-25T14:45:47Z","body":"```js\r\nparser.addArgument(['-t', '--type'], {\r\n\tdefaultValue: 'regular',\r\n\r\n\ttype (value) {\r\n\t\tif (!/^(regular|pdd|external)$/.test(value)) {\r\n\t\t\tLogger.error(`\"-t/--type\": ${this.help}`);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t},\r\n\r\n\thelp: 'Account type can be [regular | pdd | external]'\r\n});\r\n```\r\n\r\nIt seems expected and useful behavior, why not?"}}