Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atob is undefined depending on the call context #196

Closed
firehist opened this issue Jun 4, 2015 · 6 comments · Fixed by #198
Closed

atob is undefined depending on the call context #196

firehist opened this issue Jun 4, 2015 · 6 comments · Fixed by #198

Comments

@firehist
Copy link
Contributor

firehist commented Jun 4, 2015

I work w/ TypeScript and angular framework. When I call for exemple repo.write(...) from a service method, atob is null whereas window.atob works well.

@aendra-rininsland
Copy link
Member

I'm not sure I understand what the issue is. atob isn't ever even defined or used in github.js... Why is this necessary? What does this have to do with btoa, as per the issue title?

Further, your PR breaks the tests.

Please explain the issue better and I'll reopen. Thanks!

@firehist
Copy link
Contributor Author

firehist commented Jun 4, 2015

I'll do it ASAP.
I'll describe more this bug and fix tests!

@firehist
Copy link
Contributor Author

firehist commented Jun 5, 2015

Hello @Aendrew

It's the same problem on this issue #178
Please find a jsfiddle to demonstrate the problem: http://jsfiddle.net/firehist/1a31jLzy/

Solutions are:

  • remove the var to avoid hoisting
  • declare atob = window.atob

Block browser usage.
Bennnou.

@aendra-rininsland
Copy link
Member

@firehist It's not at all the same problem as #178 — that refers to btoa (base64 to ascii), not atob (ascii to base64). AFAIK, github.js makes no use of the latter, which is what you're proposing.

@firehist
Copy link
Contributor Author

firehist commented Jun 9, 2015

@Aendrew My bad, I speak about #198 which fix atob and not btoa.

@firehist firehist changed the title btoa is undefined depending on the call context atob is undefined depending on the call context Jun 9, 2015
@aendra-rininsland
Copy link
Member

@firehist That's your own pull request, which is still causing tests to fail...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants