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

Error constructor has second argument #1238

Closed
cawa-93 opened this issue Jan 4, 2022 · 5 comments
Closed

Error constructor has second argument #1238

cawa-93 opened this issue Jan 4, 2022 · 5 comments

Comments

@cawa-93
Copy link
Contributor

cawa-93 commented Jan 4, 2022

The Error constructor has signature Error ( message [ , options ] )
https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-error-message

But at the moment, trying to set cause or read cause leads to a type error. Playground

@yume-chan
Copy link
Contributor

yume-chan commented Mar 1, 2022

Error is a ECMAScript type, not from DOM spec, so see microsoft/TypeScript#45167

@yume-chan
Copy link
Contributor

@everhardt They were added in TypeScript 4.6.

@everhardt
Copy link

@yume-chan . Yes indeed. I don't get your point though, you still need to set target to ES2022 to make it work right?

@yume-chan
Copy link
Contributor

This issue was filed before TS 4.6 and target: ES2022. The information you provided is correct.

@cawa-93 cawa-93 closed this as completed Mar 18, 2022
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

No branches or pull requests

3 participants