-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Signed-off-by: Abdul-Azeez Lawal <[email protected]>
- Loading branch information
Showing
12 changed files
with
218 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 23 additions & 9 deletions
32
tests/baselines/reference/errorCause(target=es2021).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 27 additions & 10 deletions
37
tests/baselines/reference/errorCause(target=es2021).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,62 @@ | ||
=== tests/cases/compiler/errorCause.ts === | ||
declare const a: unknown; | ||
>a : Symbol(a, Decl(errorCause.ts, 0, 13)) | ||
|
||
let err = new Error("foo", { cause: new Error("bar") }); | ||
>err : Symbol(err, Decl(errorCause.ts, 0, 3)) | ||
>err : Symbol(err, Decl(errorCause.ts, 2, 3)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 0, 28)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 2, 28)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
|
||
err.cause; | ||
>err : Symbol(err, Decl(errorCause.ts, 0, 3)) | ||
>err : Symbol(err, Decl(errorCause.ts, 2, 3)) | ||
|
||
let anotherErr = new Error("foo", { cause: a }); | ||
>anotherErr : Symbol(anotherErr, Decl(errorCause.ts, 4, 3)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 4, 35)) | ||
>a : Symbol(a, Decl(errorCause.ts, 0, 13)) | ||
|
||
anotherErr.cause; | ||
>anotherErr : Symbol(anotherErr, Decl(errorCause.ts, 4, 3)) | ||
|
||
new EvalError("foo", { cause: new Error("bar") }); | ||
>EvalError : Symbol(EvalError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 3, 22)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 7, 22)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
|
||
new EvalError("foo", { cause: a }); | ||
>EvalError : Symbol(EvalError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 8, 22)) | ||
>a : Symbol(a, Decl(errorCause.ts, 0, 13)) | ||
|
||
new RangeError("foo", { cause: new Error("bar") }); | ||
>RangeError : Symbol(RangeError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 4, 23)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 9, 23)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
|
||
new ReferenceError("foo", { cause: new Error("bar") }); | ||
>ReferenceError : Symbol(ReferenceError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 5, 27)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 10, 27)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
|
||
new SyntaxError("foo", { cause: new Error("bar") }); | ||
>SyntaxError : Symbol(SyntaxError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 6, 24)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 11, 24)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
|
||
new TypeError("foo", { cause: new Error("bar") }); | ||
>TypeError : Symbol(TypeError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 7, 22)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 12, 22)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
|
||
new URIError("foo", { cause: new Error("bar") }); | ||
>URIError : Symbol(URIError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 8, 21)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 13, 21)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
|
||
new AggregateError([], "foo", { cause: new Error("bar") }); | ||
>AggregateError : Symbol(AggregateError, Decl(lib.es2021.promise.d.ts, --, --), Decl(lib.es2021.promise.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 9, 31)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 14, 31)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 29 additions & 10 deletions
39
tests/baselines/reference/errorCause(target=es2022).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,66 @@ | ||
=== tests/cases/compiler/errorCause.ts === | ||
declare const a: unknown; | ||
>a : Symbol(a, Decl(errorCause.ts, 0, 13)) | ||
|
||
let err = new Error("foo", { cause: new Error("bar") }); | ||
>err : Symbol(err, Decl(errorCause.ts, 0, 3)) | ||
>err : Symbol(err, Decl(errorCause.ts, 2, 3)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 0, 28)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 2, 28)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) | ||
|
||
err.cause; | ||
>err.cause : Symbol(Error.cause, Decl(lib.es2022.error.d.ts, --, --)) | ||
>err : Symbol(err, Decl(errorCause.ts, 0, 3)) | ||
>err : Symbol(err, Decl(errorCause.ts, 2, 3)) | ||
>cause : Symbol(Error.cause, Decl(lib.es2022.error.d.ts, --, --)) | ||
|
||
let anotherErr = new Error("foo", { cause: a }); | ||
>anotherErr : Symbol(anotherErr, Decl(errorCause.ts, 4, 3)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 4, 35)) | ||
>a : Symbol(a, Decl(errorCause.ts, 0, 13)) | ||
|
||
anotherErr.cause; | ||
>anotherErr.cause : Symbol(Error.cause, Decl(lib.es2022.error.d.ts, --, --)) | ||
>anotherErr : Symbol(anotherErr, Decl(errorCause.ts, 4, 3)) | ||
>cause : Symbol(Error.cause, Decl(lib.es2022.error.d.ts, --, --)) | ||
|
||
new EvalError("foo", { cause: new Error("bar") }); | ||
>EvalError : Symbol(EvalError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 3, 22)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 7, 22)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) | ||
|
||
new EvalError("foo", { cause: a }); | ||
>EvalError : Symbol(EvalError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 8, 22)) | ||
>a : Symbol(a, Decl(errorCause.ts, 0, 13)) | ||
|
||
new RangeError("foo", { cause: new Error("bar") }); | ||
>RangeError : Symbol(RangeError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 4, 23)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 9, 23)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) | ||
|
||
new ReferenceError("foo", { cause: new Error("bar") }); | ||
>ReferenceError : Symbol(ReferenceError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 5, 27)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 10, 27)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) | ||
|
||
new SyntaxError("foo", { cause: new Error("bar") }); | ||
>SyntaxError : Symbol(SyntaxError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 6, 24)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 11, 24)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) | ||
|
||
new TypeError("foo", { cause: new Error("bar") }); | ||
>TypeError : Symbol(TypeError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 7, 22)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 12, 22)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) | ||
|
||
new URIError("foo", { cause: new Error("bar") }); | ||
>URIError : Symbol(URIError, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 8, 21)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 13, 21)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) | ||
|
||
new AggregateError([], "foo", { cause: new Error("bar") }); | ||
>AggregateError : Symbol(AggregateError, Decl(lib.es2021.promise.d.ts, --, --), Decl(lib.es2021.promise.d.ts, --, --)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 9, 31)) | ||
>cause : Symbol(cause, Decl(errorCause.ts, 14, 31)) | ||
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.