map(atob) doesn't work without wrapper function
See original GitHub issueRxJs version 5.5.2 (also in the docs page, in the console, same problem)
Code to reproduce:
Rx.Observable.of("eyJmaXJzdE5hbWUiOiJSYWZhbCIsImxhc3ROYW1lIjoiTWFzemtvd3NraSIsImVtYWlsIjoidGVzdEB0ZXN0LnBsIiwidG9rZW4iOiJ0b2tlbiJ9")
.map(atob)
.subscribe(console.log);
Expected behavior:
should log "{"firstName":"Rafal","lastName":"Maszkowski","email":"test@test.pl","token":"token"}"
Actual behavior: logs error: Uncaught TypeError: Illegal invocation at eval (eval at MapSubscriber._next (0-Rx.js:5709)
Additional information:
the 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.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Using Javascript's atob to decode base64 doesn't properly ...
Show activity on this post. I'm using the Javascript window. atob() function to decode a base64-encoded string (specifically the base64-encoded ...
Read more >Window atob() Method - W3Schools
Note. The atob() method decodes a string that has been encoded by the btoa() method.
Read more >atob() - Web APIs - MDN Web Docs
The atob() function decodes a string of data which has been encoded using Base64 encoding. You can use the btoa() method to encode...
Read more >Map with Driving Route from A to B - JSFiddle
<p>Request a driving route from A to B and display it on the map</p> ... This function will be called once the Routing...
Read more >Master map, compactMap, flatMap, reduce and filter by ...
We're going to be extending Array without own version of these higher-order functions. We can do that because the standard library does not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
the correct way is
could close this issue @kwonoj
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.