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

Doesn't compile with Google Closure Compiler anymore #607

Closed
jscheid opened this issue Mar 28, 2017 · 4 comments
Closed

Doesn't compile with Google Closure Compiler anymore #607

jscheid opened this issue Mar 28, 2017 · 4 comments

Comments

@jscheid
Copy link

jscheid commented Mar 28, 2017

Hi,

I've been minifying xlsx using Google Closure Compiler for months now, always worked fine. But since upgrading from 0.9.3 to 0.9.6 I'm getting the following error.

stdin:20562: ERROR - constant self assigned a value more than once.
Original definition at externs.zip//browser/window.js:70
		if(typeof self == 'undefined' && typeof app != 'undefined') self = app;

It seems to be caused by this change:

70c48a7#diff-6b0da2a0ba02b003f8c2e16a0e39cbdcR12

The line mentioned in the error message is this one:
https://github.com/google/closure-compiler/blob/ab4617a86346e659253593b11d2570fa26300415/externs/browser/window.js#L68

As far as I gather, Closure Compiler thinks that self here refers to https://developer.mozilla.org/en/docs/Web/API/Window/self which is a read-only property.

This might be a bug in Closure Compiler, but I wonder if it would be possible to use a different variable name?

@SheetJSDev
Copy link
Contributor

Sorry about that! We had to make some changes to the shim to support Adobe products (see #603) and we left the line in. Removing it does not affect the result in extendscript so we will remove the line in the source and push a new version of the module momentarily.

@SheetJSDev
Copy link
Contributor

@jscheid
Copy link
Author

jscheid commented Mar 28, 2017

I've also just tested with 0.9.7, works perfectly now. That was a really quick turnaround, many thanks!

@SheetJSDev
Copy link
Contributor

@jscheid closure actually revealed a bug in flow/jshint! We were getting ready to make a release this week anyway :)

jshint/jshint#3116

facebook/flow#3601

saarCiklum pushed a commit to Folcon/js-xlsx that referenced this issue Aug 19, 2020
- write !cols widths : XLSX XLSB XLML
- write hyperlinks   :           XLML
- XLSB convert date cell to numeric on write
- fixed issue with assigning self in jszip

issues:
- closes SheetJS#607 h/t @jscheid
- closes SheetJS#195 h/t @asfman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants