closure-compiler icon indicating copy to clipboard operation
closure-compiler copied to clipboard

ES2022 Error option in constructor is not polyfilled

Open jzhan-canva opened this issue 9 months ago • 1 comments

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

jzhan-canva avatar Apr 16 '25 01:04 jzhan-canva

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 avatar Apr 23 '25 16:04 brad4d