Skip to content

ES2022 Error option in constructor is not polyfilled #4233

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

Open
jzhan-canva opened this issue Apr 16, 2025 · 1 comment
Open

ES2022 Error option in constructor is not polyfilled #4233

jzhan-canva opened this issue Apr 16, 2025 · 1 comment
Labels

Comments

@jzhan-canva
Copy link
Contributor

jzhan-canva commented Apr 16, 2025

In ES2022, Error constructor can receives 2nd argument option: {cause?: unknown}
I can see closure compiler's extern is updated to reflect this
However, the constructor is not polyfilled
This makes the old browser miss the cause information even if option.cause is provided to constructor

I understand this is tricky to polyfill, as js.comp.polyfill is only capable polyfilling something that is missing, where in this case it's extending a existing constructor

@brad4d
Copy link
Contributor

brad4d commented Apr 23, 2025

It's not clear how we could polyfill this.
It seems like any attempt would be imperfect at best.
It doesn't really seem worth doing.

We are willing to review a PR if someone wants to create one.

@brad4d brad4d added the P4 label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants