HoriSun / closure-compiler

Automatically exported from code.google.com/p/closure-compiler
0 stars 0 forks source link

Declare btoa and atob as externs #1294

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

shouldn't it be possible to use btoa() and atob() right away?

I fixed the following errors by using window['btoa'] and window['atob'], but 
shouldn't they be added to the externs?

ERROR - variable atob is undeclared
            hash = JSON.parse(atob(hash));
                              ^

ERROR - variable btoa is undeclared
            hash = btoa(JSON.stringify({

Robert

Original issue reported on code.google.com by seo...@googlemail.com on 4 Apr 2014 at 12:10

GoogleCodeExporter commented 9 years ago
Currently, they are defined in the externs as Window.prototype.btoa and 
Window.prototype.atob. 

https://developer.mozilla.org/en-US/docs/Web/API/Window.btoa

Original comment by concavel...@gmail.com on 5 Apr 2014 at 11:55

GoogleCodeExporter commented 9 years ago
Issue tracking has been migrated to github. Please make any further comments on 
this issue through https://github.com/google/closure-compiler/issues

Original comment by blic...@google.com on 1 May 2014 at 6:31

GoogleCodeExporter commented 9 years ago

Original comment by blic...@google.com on 1 May 2014 at 6:34