{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/rxjs/issues/3305","repository_url":"https://api.github.com/repos/ReactiveX/rxjs","labels_url":"https://api.github.com/repos/ReactiveX/rxjs/issues/3305/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/rxjs/issues/3305/comments","events_url":"https://api.github.com/repos/ReactiveX/rxjs/issues/3305/events","html_url":"https://github.com/ReactiveX/rxjs/issues/3305","id":295470397,"number":3305,"title":"map(atob) doesn't work without wrapper function","user":{"login":"franciscotln","id":14295014,"avatar_url":"https://avatars2.githubusercontent.com/u/14295014?v=4","gravatar_id":"","url":"https://api.github.com/users/franciscotln","html_url":"https://github.com/franciscotln","followers_url":"https://api.github.com/users/franciscotln/followers","following_url":"https://api.github.com/users/franciscotln/following{/other_user}","gists_url":"https://api.github.com/users/franciscotln/gists{/gist_id}","starred_url":"https://api.github.com/users/franciscotln/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franciscotln/subscriptions","organizations_url":"https://api.github.com/users/franciscotln/orgs","repos_url":"https://api.github.com/users/franciscotln/repos","events_url":"https://api.github.com/users/franciscotln/events{/privacy}","received_events_url":"https://api.github.com/users/franciscotln/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-08T11:05:29Z","updated_at":"2018-03-15T19:03:08Z","closed_at":"2018-03-15T19:03:08Z","author_association":"NONE","body":"**RxJs version**\r\n5.5.2 (also in the docs page, in the console, same problem)\r\n\r\n**Code to reproduce:**\r\n```js\r\nRx.Observable.of(\"eyJmaXJzdE5hbWUiOiJSYWZhbCIsImxhc3ROYW1lIjoiTWFzemtvd3NraSIsImVtYWlsIjoidGVzdEB0ZXN0LnBsIiwidG9rZW4iOiJ0b2tlbiJ9\")\r\n.map(atob)\r\n.subscribe(console.log);\r\n```\r\n\r\n**Expected behavior:**\r\nshould log `\"{\"firstName\":\"Rafal\",\"lastName\":\"Maszkowski\",\"email\":\"test@test.pl\",\"token\":\"token\"}\"`\r\n\r\n**Actual behavior:**\r\nlogs error: Uncaught TypeError: Illegal invocation at eval (eval at MapSubscriber._next (0-Rx.js:5709)\r\n\r\n**Additional information:**\r\nthe problem I found in the source code is in MapSubscriber. The project function `this.project` is called via `this.project.call(this.thisArg, value, this.count++);` but `atob` doesn't work if the thisArg isn't null/undefined/window."},"comment":{"url":"https://api.github.com/repos/ReactiveX/rxjs/issues/comments/373488335","html_url":"https://github.com/ReactiveX/rxjs/issues/3305#issuecomment-373488335","issue_url":"https://api.github.com/repos/ReactiveX/rxjs/issues/3305","id":373488335,"user":{"login":"benlesh","id":1540597,"avatar_url":"https://avatars0.githubusercontent.com/u/1540597?v=4","gravatar_id":"","url":"https://api.github.com/users/benlesh","html_url":"https://github.com/benlesh","followers_url":"https://api.github.com/users/benlesh/followers","following_url":"https://api.github.com/users/benlesh/following{/other_user}","gists_url":"https://api.github.com/users/benlesh/gists{/gist_id}","starred_url":"https://api.github.com/users/benlesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlesh/subscriptions","organizations_url":"https://api.github.com/users/benlesh/orgs","repos_url":"https://api.github.com/users/benlesh/repos","events_url":"https://api.github.com/users/benlesh/events{/privacy}","received_events_url":"https://api.github.com/users/benlesh/received_events","type":"User","site_admin":false},"created_at":"2018-03-15T19:03:07Z","updated_at":"2018-03-15T19:03:07Z","author_association":"OWNER","body":"@dengwanc's solution is correct. Closing this one."}}
{"actor":{"display_login":"benlesh"}}