{"action":"created","issue":{"url":"https://api.github.com/repos/jquery/esprima/issues/1342","labels_url":"https://api.github.com/repos/jquery/esprima/issues/1342/labels{/name}","comments_url":"https://api.github.com/repos/jquery/esprima/issues/1342/comments","events_url":"https://api.github.com/repos/jquery/esprima/issues/1342/events","html_url":"https://github.com/jquery/esprima/pull/1342","id":110971358,"number":1342,"title":"Add the support for token delegator.","user":{"login":"ariya","id":7288,"avatar_url":"https://avatars.githubusercontent.com/u/7288?v=3","gravatar_id":"","url":"https://api.github.com/users/ariya","html_url":"https://github.com/ariya","followers_url":"https://api.github.com/users/ariya/followers","following_url":"https://api.github.com/users/ariya/following{/other_user}","gists_url":"https://api.github.com/users/ariya/gists{/gist_id}","starred_url":"https://api.github.com/users/ariya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariya/subscriptions","organizations_url":"https://api.github.com/users/ariya/orgs","repos_url":"https://api.github.com/users/ariya/repos","events_url":"https://api.github.com/users/ariya/events{/privacy}","received_events_url":"https://api.github.com/users/ariya/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jquery/esprima/labels/CLA:%20Valid","name":"CLA: Valid","color":"007700"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-12T13:06:08Z","updated_at":"2015-10-12T14:59:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jquery/esprima/pulls/1342","html_url":"https://github.com/jquery/esprima/pull/1342","diff_url":"https://github.com/jquery/esprima/pull/1342.diff","patch_url":"https://github.com/jquery/esprima/pull/1342.patch"},"body":"The third parameter to the `tokenize()` function is a callback function\r\nthat is invoked every time the tokenizer encounters a new token. The\r\nreturn value of this callback function will be appended to the list of\r\ntokens to be returned by `tokenize()`.\r\n\r\nAn example that returns ['answer', '=', '42']:\r\n\r\n  esprima.tokenize('answer = 42', { range: true }, function (token) {\r\n    return token.value;\r\n  });\r\n\r\nFixes #1332"},"comment":{"url":"https://api.github.com/repos/jquery/esprima/issues/comments/147424636","html_url":"https://github.com/jquery/esprima/pull/1342#issuecomment-147424636","issue_url":"https://api.github.com/repos/jquery/esprima/issues/1342","id":147424636,"user":{"login":"michaelficarra","id":218840,"avatar_url":"https://avatars.githubusercontent.com/u/218840?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelficarra","html_url":"https://github.com/michaelficarra","followers_url":"https://api.github.com/users/michaelficarra/followers","following_url":"https://api.github.com/users/michaelficarra/following{/other_user}","gists_url":"https://api.github.com/users/michaelficarra/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelficarra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelficarra/subscriptions","organizations_url":"https://api.github.com/users/michaelficarra/orgs","repos_url":"https://api.github.com/users/michaelficarra/repos","events_url":"https://api.github.com/users/michaelficarra/events{/privacy}","received_events_url":"https://api.github.com/users/michaelficarra/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T14:59:45Z","updated_at":"2015-10-12T14:59:45Z","body":"No, this is even worse than I imagined. I strongly urge you to either use another strategy.\r\n\r\n* conform to the ES6 iterator interface\r\n* allow ES6 promises to be returned\r\n* pass in another callback to the delegator callback for two-way async communication\r\n* *anything* that is more powerful than a simple synchronous callback"}}