Skip to content

Commit c84a42d

Browse files
committed
samples/*/typescript-fetch: re-generate runtime.ts
1 parent 91b9756 commit c84a42d

18 files changed

Lines changed: 432 additions & 0 deletions

File tree

samples/client/others/typescript-fetch/infinite-recursion-issue/runtime.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,44 @@ export class ResponseError extends Error {
261261
override name: "ResponseError" = "ResponseError";
262262
constructor(public response: Response, msg?: string) {
263263
super(msg);
264+
265+
// restore prototype chain
266+
const actualProto = new.target.prototype;
267+
if (Object.setPrototypeOf) {
268+
Object.setPrototypeOf(this, actualProto);
269+
} else {
270+
this.__proto__ = actualProto;
271+
}
264272
}
265273
}
266274

267275
export class FetchError extends Error {
268276
override name: "FetchError" = "FetchError";
269277
constructor(public cause: Error, msg?: string) {
270278
super(msg);
279+
280+
// restore prototype chain
281+
const actualProto = new.target.prototype;
282+
if (Object.setPrototypeOf) {
283+
Object.setPrototypeOf(this, actualProto);
284+
} else {
285+
this.__proto__ = actualProto;
286+
}
271287
}
272288
}
273289

274290
export class RequiredError extends Error {
275291
override name: "RequiredError" = "RequiredError";
276292
constructor(public field: string, msg?: string) {
277293
super(msg);
294+
295+
// restore prototype chain
296+
const actualProto = new.target.prototype;
297+
if (Object.setPrototypeOf) {
298+
Object.setPrototypeOf(this, actualProto);
299+
} else {
300+
this.__proto__ = actualProto;
301+
}
278302
}
279303
}
280304

samples/client/others/typescript-fetch/self-import-issue/runtime.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,44 @@ export class ResponseError extends Error {
261261
override name: "ResponseError" = "ResponseError";
262262
constructor(public response: Response, msg?: string) {
263263
super(msg);
264+
265+
// restore prototype chain
266+
const actualProto = new.target.prototype;
267+
if (Object.setPrototypeOf) {
268+
Object.setPrototypeOf(this, actualProto);
269+
} else {
270+
this.__proto__ = actualProto;
271+
}
264272
}
265273
}
266274

267275
export class FetchError extends Error {
268276
override name: "FetchError" = "FetchError";
269277
constructor(public cause: Error, msg?: string) {
270278
super(msg);
279+
280+
// restore prototype chain
281+
const actualProto = new.target.prototype;
282+
if (Object.setPrototypeOf) {
283+
Object.setPrototypeOf(this, actualProto);
284+
} else {
285+
this.__proto__ = actualProto;
286+
}
271287
}
272288
}
273289

274290
export class RequiredError extends Error {
275291
override name: "RequiredError" = "RequiredError";
276292
constructor(public field: string, msg?: string) {
277293
super(msg);
294+
295+
// restore prototype chain
296+
const actualProto = new.target.prototype;
297+
if (Object.setPrototypeOf) {
298+
Object.setPrototypeOf(this, actualProto);
299+
} else {
300+
this.__proto__ = actualProto;
301+
}
278302
}
279303
}
280304

samples/client/petstore/typescript-fetch/builds/allOf-nullable/runtime.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,44 @@ export class ResponseError extends Error {
261261
override name: "ResponseError" = "ResponseError";
262262
constructor(public response: Response, msg?: string) {
263263
super(msg);
264+
265+
// restore prototype chain
266+
const actualProto = new.target.prototype;
267+
if (Object.setPrototypeOf) {
268+
Object.setPrototypeOf(this, actualProto);
269+
} else {
270+
this.__proto__ = actualProto;
271+
}
264272
}
265273
}
266274

267275
export class FetchError extends Error {
268276
override name: "FetchError" = "FetchError";
269277
constructor(public cause: Error, msg?: string) {
270278
super(msg);
279+
280+
// restore prototype chain
281+
const actualProto = new.target.prototype;
282+
if (Object.setPrototypeOf) {
283+
Object.setPrototypeOf(this, actualProto);
284+
} else {
285+
this.__proto__ = actualProto;
286+
}
271287
}
272288
}
273289

274290
export class RequiredError extends Error {
275291
override name: "RequiredError" = "RequiredError";
276292
constructor(public field: string, msg?: string) {
277293
super(msg);
294+
295+
// restore prototype chain
296+
const actualProto = new.target.prototype;
297+
if (Object.setPrototypeOf) {
298+
Object.setPrototypeOf(this, actualProto);
299+
} else {
300+
this.__proto__ = actualProto;
301+
}
278302
}
279303
}
280304

samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,44 @@ export class ResponseError extends Error {
261261
override name: "ResponseError" = "ResponseError";
262262
constructor(public response: Response, msg?: string) {
263263
super(msg);
264+
265+
// restore prototype chain
266+
const actualProto = new.target.prototype;
267+
if (Object.setPrototypeOf) {
268+
Object.setPrototypeOf(this, actualProto);
269+
} else {
270+
this.__proto__ = actualProto;
271+
}
264272
}
265273
}
266274

267275
export class FetchError extends Error {
268276
override name: "FetchError" = "FetchError";
269277
constructor(public cause: Error, msg?: string) {
270278
super(msg);
279+
280+
// restore prototype chain
281+
const actualProto = new.target.prototype;
282+
if (Object.setPrototypeOf) {
283+
Object.setPrototypeOf(this, actualProto);
284+
} else {
285+
this.__proto__ = actualProto;
286+
}
271287
}
272288
}
273289

274290
export class RequiredError extends Error {
275291
override name: "RequiredError" = "RequiredError";
276292
constructor(public field: string, msg?: string) {
277293
super(msg);
294+
295+
// restore prototype chain
296+
const actualProto = new.target.prototype;
297+
if (Object.setPrototypeOf) {
298+
Object.setPrototypeOf(this, actualProto);
299+
} else {
300+
this.__proto__ = actualProto;
301+
}
278302
}
279303
}
280304

samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,44 @@ export class ResponseError extends Error {
261261
override name: "ResponseError" = "ResponseError";
262262
constructor(public response: Response, msg?: string) {
263263
super(msg);
264+
265+
// restore prototype chain
266+
const actualProto = new.target.prototype;
267+
if (Object.setPrototypeOf) {
268+
Object.setPrototypeOf(this, actualProto);
269+
} else {
270+
this.__proto__ = actualProto;
271+
}
264272
}
265273
}
266274

267275
export class FetchError extends Error {
268276
override name: "FetchError" = "FetchError";
269277
constructor(public cause: Error, msg?: string) {
270278
super(msg);
279+
280+
// restore prototype chain
281+
const actualProto = new.target.prototype;
282+
if (Object.setPrototypeOf) {
283+
Object.setPrototypeOf(this, actualProto);
284+
} else {
285+
this.__proto__ = actualProto;
286+
}
271287
}
272288
}
273289

274290
export class RequiredError extends Error {
275291
override name: "RequiredError" = "RequiredError";
276292
constructor(public field: string, msg?: string) {
277293
super(msg);
294+
295+
// restore prototype chain
296+
const actualProto = new.target.prototype;
297+
if (Object.setPrototypeOf) {
298+
Object.setPrototypeOf(this, actualProto);
299+
} else {
300+
this.__proto__ = actualProto;
301+
}
278302
}
279303
}
280304

samples/client/petstore/typescript-fetch/builds/default/runtime.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,44 @@ export class ResponseError extends Error {
261261
override name: "ResponseError" = "ResponseError";
262262
constructor(public response: Response, msg?: string) {
263263
super(msg);
264+
265+
// restore prototype chain
266+
const actualProto = new.target.prototype;
267+
if (Object.setPrototypeOf) {
268+
Object.setPrototypeOf(this, actualProto);
269+
} else {
270+
this.__proto__ = actualProto;
271+
}
264272
}
265273
}
266274

267275
export class FetchError extends Error {
268276
override name: "FetchError" = "FetchError";
269277
constructor(public cause: Error, msg?: string) {
270278
super(msg);
279+
280+
// restore prototype chain
281+
const actualProto = new.target.prototype;
282+
if (Object.setPrototypeOf) {
283+
Object.setPrototypeOf(this, actualProto);
284+
} else {
285+
this.__proto__ = actualProto;
286+
}
271287
}
272288
}
273289

274290
export class RequiredError extends Error {
275291
override name: "RequiredError" = "RequiredError";
276292
constructor(public field: string, msg?: string) {
277293
super(msg);
294+
295+
// restore prototype chain
296+
const actualProto = new.target.prototype;
297+
if (Object.setPrototypeOf) {
298+
Object.setPrototypeOf(this, actualProto);
299+
} else {
300+
this.__proto__ = actualProto;
301+
}
278302
}
279303
}
280304

samples/client/petstore/typescript-fetch/builds/enum/runtime.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,44 @@ export class ResponseError extends Error {
261261
override name: "ResponseError" = "ResponseError";
262262
constructor(public response: Response, msg?: string) {
263263
super(msg);
264+
265+
// restore prototype chain
266+
const actualProto = new.target.prototype;
267+
if (Object.setPrototypeOf) {
268+
Object.setPrototypeOf(this, actualProto);
269+
} else {
270+
this.__proto__ = actualProto;
271+
}
264272
}
265273
}
266274

267275
export class FetchError extends Error {
268276
override name: "FetchError" = "FetchError";
269277
constructor(public cause: Error, msg?: string) {
270278
super(msg);
279+
280+
// restore prototype chain
281+
const actualProto = new.target.prototype;
282+
if (Object.setPrototypeOf) {
283+
Object.setPrototypeOf(this, actualProto);
284+
} else {
285+
this.__proto__ = actualProto;
286+
}
271287
}
272288
}
273289

274290
export class RequiredError extends Error {
275291
override name: "RequiredError" = "RequiredError";
276292
constructor(public field: string, msg?: string) {
277293
super(msg);
294+
295+
// restore prototype chain
296+
const actualProto = new.target.prototype;
297+
if (Object.setPrototypeOf) {
298+
Object.setPrototypeOf(this, actualProto);
299+
} else {
300+
this.__proto__ = actualProto;
301+
}
278302
}
279303
}
280304

samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,44 @@ export class ResponseError extends Error {
261261
override name: "ResponseError" = "ResponseError";
262262
constructor(public response: Response, msg?: string) {
263263
super(msg);
264+
265+
// restore prototype chain
266+
const actualProto = new.target.prototype;
267+
if (Object.setPrototypeOf) {
268+
Object.setPrototypeOf(this, actualProto);
269+
} else {
270+
this.__proto__ = actualProto;
271+
}
264272
}
265273
}
266274

267275
export class FetchError extends Error {
268276
override name: "FetchError" = "FetchError";
269277
constructor(public cause: Error, msg?: string) {
270278
super(msg);
279+
280+
// restore prototype chain
281+
const actualProto = new.target.prototype;
282+
if (Object.setPrototypeOf) {
283+
Object.setPrototypeOf(this, actualProto);
284+
} else {
285+
this.__proto__ = actualProto;
286+
}
271287
}
272288
}
273289

274290
export class RequiredError extends Error {
275291
override name: "RequiredError" = "RequiredError";
276292
constructor(public field: string, msg?: string) {
277293
super(msg);
294+
295+
// restore prototype chain
296+
const actualProto = new.target.prototype;
297+
if (Object.setPrototypeOf) {
298+
Object.setPrototypeOf(this, actualProto);
299+
} else {
300+
this.__proto__ = actualProto;
301+
}
278302
}
279303
}
280304

0 commit comments

Comments
 (0)