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

(docs): set prototype of RegExp correctly. #1700

Merged
merged 3 commits into from
Nov 18, 2021

Conversation

joeldenning
Copy link
Contributor

Summary

Today myself and others diagnosed an issue related to the documentation for IE11.

The existing documentation is incorrect because it changes the RegExp function such that RegExp.prototype.exec is no longer defined. After the exceljs IE11 polyfill, one must use RegExp.prototype.prototype.exec instead of RegExp.prototype.exec when trying to call exec directly. The reason is that RegExp.prototype is set to RegExp instead of RegExp.prototype, which adds an extra layer to the prototype chain.

It is reasonable to expect RegExp.prototype.exec to be defined, and for the API for using regular expressions to be unchanged after applying the polyfill in the exceljs documentation.

The fix here restores normal behavior for RegExp.prototype.exec.

Test plan

We verified this in our production application. But since this a bug in the documentation, there are no automated tests included in my PR.

Related to source code (for typings update)

N/A

@Siemienik Siemienik self-requested a review November 18, 2021 00:58
@Siemienik
Copy link
Member

LGTM, Thank you @joeldenning

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