Skip to content

Commit 3f377b9

Browse files
authored
Do not emit toString() on class static declarations (#1513)
Co-authored-by: saschanaz <[email protected]>
1 parent 08d4952 commit 3f377b9

File tree

6 files changed

+2
-18
lines changed

6 files changed

+2
-18
lines changed

baselines/audioworklet.generated.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,6 @@ interface URLSearchParams {
713713
declare var URLSearchParams: {
714714
prototype: URLSearchParams;
715715
new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
716-
toString(): string;
717716
};
718717

719718
/** Available only in secure contexts. */

baselines/dom.generated.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4110,7 +4110,6 @@ declare var DOMMatrixReadOnly: {
41104110
fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly;
41114111
fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly;
41124112
fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly;
4113-
toString(): string;
41144113
};
41154114

41164115
/** Provides the ability to parse XML or HTML source code from a string into a DOM Document. */
@@ -11751,7 +11750,6 @@ declare var Range: {
1175111750
readonly START_TO_END: 1;
1175211751
readonly END_TO_END: 2;
1175311752
readonly END_TO_START: 3;
11754-
toString(): string;
1175511753
};
1175611754

1175711755
interface ReadableByteStreamController {
@@ -13783,7 +13781,6 @@ interface Selection {
1378313781
declare var Selection: {
1378413782
prototype: Selection;
1378513783
new(): Selection;
13786-
toString(): string;
1378713784
};
1378813785

1378913786
interface ServiceWorkerEventMap extends AbstractWorkerEventMap {
@@ -14707,7 +14704,6 @@ interface URLSearchParams {
1470714704
declare var URLSearchParams: {
1470814705
prototype: URLSearchParams;
1470914706
new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
14710-
toString(): string;
1471114707
};
1471214708

1471314709
interface VTTCue extends TextTrackCue {

baselines/serviceworker.generated.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3285,7 +3285,6 @@ interface URLSearchParams {
32853285
declare var URLSearchParams: {
32863286
prototype: URLSearchParams;
32873287
new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
3288-
toString(): string;
32893288
};
32903289

32913290
interface WEBGL_color_buffer_float {

baselines/sharedworker.generated.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3149,7 +3149,6 @@ interface URLSearchParams {
31493149
declare var URLSearchParams: {
31503150
prototype: URLSearchParams;
31513151
new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
3152-
toString(): string;
31533152
};
31543153

31553154
interface WEBGL_color_buffer_float {

baselines/webworker.generated.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3426,7 +3426,6 @@ interface URLSearchParams {
34263426
declare var URLSearchParams: {
34273427
prototype: URLSearchParams;
34283428
new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
3429-
toString(): string;
34303429
};
34313430

34323431
interface VideoColorSpace {

src/build/emitter.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -909,15 +909,7 @@ export function emitWebIdl(
909909
return emitQuerySelectorAllOverloads(m);
910910
}
911911

912-
// ignore toString() provided from browser.webidl.preprocessed.json
913-
// to prevent duplication
914-
if (m.name !== "toString") {
915-
emitSignatures(m, prefix, m.name, printLine);
916-
917-
if (m.stringifier) {
918-
printLine("toString(): string;");
919-
}
920-
}
912+
emitSignatures(m, prefix, m.name, printLine);
921913
}
922914

923915
function emitSignature(
@@ -989,7 +981,7 @@ export function emitWebIdl(
989981
.sort(compareName)
990982
.forEach((m) => emitMethod(prefix, m, conflictedMembers));
991983
}
992-
if (i.anonymousMethods) {
984+
if (i.anonymousMethods && emitScope === EmitScope.InstanceOnly) {
993985
const stringifier = i.anonymousMethods.method.find((m) => m.stringifier);
994986
if (stringifier) {
995987
printer.printLine("toString(): string;");

0 commit comments

Comments
 (0)