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

fix(zip): Tolerate XS null terminated string limitation #737

Merged
merged 1 commit into from
May 21, 2021
Merged

Conversation

kriskowal
Copy link
Member

We encounter problems when attempting to decode the Uint8Array [0, 0] into a "\x00\x00" string under XS due to a limitation of our TextDecoder shim that is based on the XS String.fromArrayBuffer function on that engine Moddable-OpenSource/moddable#644. This work-around maintains the easy values for values comparison of compression method magic numbers/strings by switching the internal representation from string to number.

@kriskowal kriskowal requested a review from dckc May 21, 2021 05:33
Copy link
Contributor

@dckc dckc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests needed updating? That doesn't seem right. Please consider adding one.

@kriskowal
Copy link
Member Author

For testing, we do have an integration test that covers this. I’ve considered writing a close unit test, but testing that close would only serve as a change detector. I think the ideal test would be one that failed before this change, which is to say, run the existing integration test except under XS. I’ve left a note to do that work after we’ve moved xnap here #739.

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 this pull request may close these issues.

2 participants