Skip to content

Commit a9460c8

Browse files
authored
Add lib declaration for RegExp#unicodeSets (microsoft#57111)
1 parent c295531 commit a9460c8

File tree

39 files changed

+246
-18
lines changed

39 files changed

+246
-18
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ const libEntries: [string, string][] = [
233233
["esnext.weakref", "lib.es2021.weakref.d.ts"],
234234
["esnext.decorators", "lib.esnext.decorators.d.ts"],
235235
["esnext.object", "lib.esnext.object.d.ts"],
236+
["esnext.regexp", "lib.esnext.regexp.d.ts"],
236237
["decorators", "lib.decorators.d.ts"],
237238
["decorators.legacy", "lib.decorators.legacy.d.ts"],
238239
];

src/lib/es2022.regexp.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface RegExpIndicesArray extends Array<[number, number]> {
1414

1515
interface RegExp {
1616
/**
17-
* Returns a Boolean value indicating the state of the hasIndices flag (d) used with with a regular expression.
17+
* Returns a Boolean value indicating the state of the hasIndices flag (d) used with a regular expression.
1818
* Default is false. Read-only.
1919
*/
2020
readonly hasIndices: boolean;

src/lib/esnext.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/// <reference lib="esnext.promise" />
66
/// <reference lib="esnext.object" />
77
/// <reference lib="esnext.collection" />
8+
/// <reference lib="esnext.regexp" />

src/lib/esnext.regexp.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
interface RegExp {
2+
/**
3+
* Returns a Boolean value indicating the state of the unicodeSets flag (v) used with a regular expression.
4+
* Default is false. Read-only.
5+
*/
6+
readonly unicodeSets: boolean;
7+
}

src/lib/libs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"esnext.promise",
7878
"esnext.object",
7979
"esnext.collection",
80+
"esnext.regexp",
8081
"decorators",
8182
"decorators.legacy",
8283
// Default libraries

tests/baselines/reference/bundlerDirectoryModule(moduleresolution=bundler).trace.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,19 @@
902902
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
903903
"Directory '/node_modules' does not exist, skipping all lookups in it.",
904904
"======== Module name '@typescript/lib-esnext/collection' was not resolved. ========",
905+
"======== Resolving module '@typescript/lib-esnext/regexp' from '/.src/__lib_node_modules_lookup_lib.esnext.regexp.d.ts__.ts'. ========",
906+
"Explicitly specified module resolution kind: 'Node10'.",
907+
"Loading module '@typescript/lib-esnext/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.",
908+
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
909+
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
910+
"Scoped package detected, looking in 'typescript__lib-esnext/regexp'",
911+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
912+
"Scoped package detected, looking in 'typescript__lib-esnext/regexp'",
913+
"Loading module '@typescript/lib-esnext/regexp' from 'node_modules' folder, target file types: JavaScript.",
914+
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
915+
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
916+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
917+
"======== Module name '@typescript/lib-esnext/regexp' was not resolved. ========",
905918
"======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========",
906919
"Explicitly specified module resolution kind: 'Node10'.",
907920
"Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.",

tests/baselines/reference/bundlerDirectoryModule(moduleresolution=nodenext).trace.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,21 @@
10441044
"======== Module name '@typescript/lib-esnext/collection' was not resolved. ========",
10451045
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
10461046
"File '/package.json' does not exist according to earlier cached lookups.",
1047+
"======== Resolving module '@typescript/lib-esnext/regexp' from '/.src/__lib_node_modules_lookup_lib.esnext.regexp.d.ts__.ts'. ========",
1048+
"Explicitly specified module resolution kind: 'Node10'.",
1049+
"Loading module '@typescript/lib-esnext/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.",
1050+
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
1051+
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
1052+
"Scoped package detected, looking in 'typescript__lib-esnext/regexp'",
1053+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
1054+
"Scoped package detected, looking in 'typescript__lib-esnext/regexp'",
1055+
"Loading module '@typescript/lib-esnext/regexp' from 'node_modules' folder, target file types: JavaScript.",
1056+
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
1057+
"Directory '/.src/node_modules' does not exist, skipping all lookups in it.",
1058+
"Directory '/node_modules' does not exist, skipping all lookups in it.",
1059+
"======== Module name '@typescript/lib-esnext/regexp' was not resolved. ========",
1060+
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
1061+
"File '/package.json' does not exist according to earlier cached lookups.",
10471062
"======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========",
10481063
"Explicitly specified module resolution kind: 'Node10'.",
10491064
"Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.",

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)