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

feat: add Error.isError() to ESNext lib #60788

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ const libEntries: [string, string][] = [
["esnext.string", "lib.es2024.string.d.ts"],
["esnext.iterator", "lib.esnext.iterator.d.ts"],
["esnext.promise", "lib.esnext.promise.d.ts"],
["esnext.error", "lib.esnext.error.d.ts"],
["decorators", "lib.decorators.d.ts"],
["decorators.legacy", "lib.decorators.legacy.d.ts"],
];
Expand Down
7 changes: 4 additions & 3 deletions src/lib/esnext.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/// <reference lib="es2024" />
/// <reference lib="esnext.intl" />
/// <reference lib="esnext.array" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this order changing?

/// <reference lib="esnext.collection" />
/// <reference lib="esnext.decorators" />
/// <reference lib="esnext.disposable" />
/// <reference lib="esnext.collection" />
/// <reference lib="esnext.array" />
/// <reference lib="esnext.error" />
/// <reference lib="esnext.intl" />
/// <reference lib="esnext.iterator" />
/// <reference lib="esnext.promise" />
6 changes: 6 additions & 0 deletions src/lib/esnext.error.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
interface ErrorConstructor {
/**
* Indicates whether the argument provided is a built-in Error instance or not.
*/
isError(error: unknown): error is Error;
}
7 changes: 4 additions & 3 deletions src/lib/libs.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@
"es2024.regexp",
"es2024.sharedmemory",
"es2024.string",
"esnext.array",
"esnext.collection",
"esnext.decorators",
"esnext.intl",
"esnext.disposable",
"esnext.collection",
"esnext.array",
"esnext.error",
"esnext.intl",
"esnext.iterator",
"esnext.promise",
"decorators",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -928,19 +928,32 @@
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-es2024/string' was not resolved. ========",
"======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========",
"======== Resolving module '@typescript/lib-esnext/array' from '/.src/__lib_node_modules_lookup_lib.esnext.array.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Loading module '@typescript/lib-esnext/array' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/intl'",
"Scoped package detected, looking in 'typescript__lib-esnext/array'",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/intl'",
"Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: JavaScript.",
"Scoped package detected, looking in 'typescript__lib-esnext/array'",
"Loading module '@typescript/lib-esnext/array' from 'node_modules' folder, target file types: JavaScript.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-esnext/intl' was not resolved. ========",
"======== Module name '@typescript/lib-esnext/array' was not resolved. ========",
"======== Resolving module '@typescript/lib-esnext/collection' from '/.src/__lib_node_modules_lookup_lib.esnext.collection.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-esnext/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/collection'",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/collection'",
"Loading module '@typescript/lib-esnext/collection' from 'node_modules' folder, target file types: JavaScript.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-esnext/collection' was not resolved. ========",
"======== Resolving module '@typescript/lib-esnext/decorators' from '/.src/__lib_node_modules_lookup_lib.esnext.decorators.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-esnext/decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.",
Expand All @@ -967,32 +980,32 @@
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-esnext/disposable' was not resolved. ========",
"======== Resolving module '@typescript/lib-esnext/collection' from '/.src/__lib_node_modules_lookup_lib.esnext.collection.d.ts__.ts'. ========",
"======== Resolving module '@typescript/lib-esnext/error' from '/.src/__lib_node_modules_lookup_lib.esnext.error.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-esnext/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Loading module '@typescript/lib-esnext/error' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/collection'",
"Scoped package detected, looking in 'typescript__lib-esnext/error'",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/collection'",
"Loading module '@typescript/lib-esnext/collection' from 'node_modules' folder, target file types: JavaScript.",
"Scoped package detected, looking in 'typescript__lib-esnext/error'",
"Loading module '@typescript/lib-esnext/error' from 'node_modules' folder, target file types: JavaScript.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-esnext/collection' was not resolved. ========",
"======== Resolving module '@typescript/lib-esnext/array' from '/.src/__lib_node_modules_lookup_lib.esnext.array.d.ts__.ts'. ========",
"======== Module name '@typescript/lib-esnext/error' was not resolved. ========",
"======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-esnext/array' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/array'",
"Scoped package detected, looking in 'typescript__lib-esnext/intl'",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/array'",
"Loading module '@typescript/lib-esnext/array' from 'node_modules' folder, target file types: JavaScript.",
"Scoped package detected, looking in 'typescript__lib-esnext/intl'",
"Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: JavaScript.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-esnext/array' was not resolved. ========",
"======== Module name '@typescript/lib-esnext/intl' was not resolved. ========",
"======== Resolving module '@typescript/lib-esnext/iterator' from '/.src/__lib_node_modules_lookup_lib.esnext.iterator.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-esnext/iterator' from 'node_modules' folder, target file types: TypeScript, Declaration.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1074,19 +1074,34 @@
"======== Module name '@typescript/lib-es2024/string' was not resolved. ========",
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========",
"======== Resolving module '@typescript/lib-esnext/array' from '/.src/__lib_node_modules_lookup_lib.esnext.array.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Loading module '@typescript/lib-esnext/array' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/intl'",
"Scoped package detected, looking in 'typescript__lib-esnext/array'",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/intl'",
"Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: JavaScript.",
"Scoped package detected, looking in 'typescript__lib-esnext/array'",
"Loading module '@typescript/lib-esnext/array' from 'node_modules' folder, target file types: JavaScript.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-esnext/intl' was not resolved. ========",
"======== Module name '@typescript/lib-esnext/array' was not resolved. ========",
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-esnext/collection' from '/.src/__lib_node_modules_lookup_lib.esnext.collection.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-esnext/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/collection'",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/collection'",
"Loading module '@typescript/lib-esnext/collection' from 'node_modules' folder, target file types: JavaScript.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-esnext/collection' was not resolved. ========",
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-esnext/decorators' from '/.src/__lib_node_modules_lookup_lib.esnext.decorators.d.ts__.ts'. ========",
Expand Down Expand Up @@ -1119,34 +1134,34 @@
"======== Module name '@typescript/lib-esnext/disposable' was not resolved. ========",
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-esnext/collection' from '/.src/__lib_node_modules_lookup_lib.esnext.collection.d.ts__.ts'. ========",
"======== Resolving module '@typescript/lib-esnext/error' from '/.src/__lib_node_modules_lookup_lib.esnext.error.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-esnext/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Loading module '@typescript/lib-esnext/error' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/collection'",
"Scoped package detected, looking in 'typescript__lib-esnext/error'",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/collection'",
"Loading module '@typescript/lib-esnext/collection' from 'node_modules' folder, target file types: JavaScript.",
"Scoped package detected, looking in 'typescript__lib-esnext/error'",
"Loading module '@typescript/lib-esnext/error' from 'node_modules' folder, target file types: JavaScript.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-esnext/collection' was not resolved. ========",
"======== Module name '@typescript/lib-esnext/error' was not resolved. ========",
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-esnext/array' from '/.src/__lib_node_modules_lookup_lib.esnext.array.d.ts__.ts'. ========",
"======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-esnext/array' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/array'",
"Scoped package detected, looking in 'typescript__lib-esnext/intl'",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-esnext/array'",
"Loading module '@typescript/lib-esnext/array' from 'node_modules' folder, target file types: JavaScript.",
"Scoped package detected, looking in 'typescript__lib-esnext/intl'",
"Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: JavaScript.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
"Directory '/node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-esnext/array' was not resolved. ========",
"======== Module name '@typescript/lib-esnext/intl' was not resolved. ========",
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-esnext/iterator' from '/.src/__lib_node_modules_lookup_lib.esnext.iterator.d.ts__.ts'. ========",
Expand Down
Loading
Loading