diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2022-12-15 16:33:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-15 10:33:19 -0500 |
commit | 50c75265260a0bcdd19fe4a3ee6439935c04ea66 (patch) | |
tree | 944de15245931015cea75e3fc463770d6b107c3b | |
parent | 585ec1218f8cdc191f2e733beb2e6c7a230ac85c (diff) |
fix: re-add Response.json static method (#17061)
Same as #16040
-rw-r--r-- | cli/tests/check_tests.rs | 5 | ||||
-rw-r--r-- | cli/tests/testdata/check/response_json.ts | 5 | ||||
-rw-r--r-- | cli/tsc/dts/lib.dom.d.ts | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/check_tests.rs b/cli/tests/check_tests.rs index 54f9cc272..60f9d3a11 100644 --- a/cli/tests/check_tests.rs +++ b/cli/tests/check_tests.rs @@ -63,6 +63,11 @@ mod check { exit_code: 0, }); + itest!(check_static_response_json { + args: "check --quiet check/response_json.ts", + exit_code: 0, + }); + #[test] fn cache_switching_config_then_no_config() { let deno_dir = util::new_deno_dir(); diff --git a/cli/tests/testdata/check/response_json.ts b/cli/tests/testdata/check/response_json.ts new file mode 100644 index 000000000..e936f7bff --- /dev/null +++ b/cli/tests/testdata/check/response_json.ts @@ -0,0 +1,5 @@ +/// <reference no-default-lib="true" /> +/// <reference lib="dom" /> +/// <reference lib="esnext" /> + +Response.json({}); diff --git a/cli/tsc/dts/lib.dom.d.ts b/cli/tsc/dts/lib.dom.d.ts index 7bdf13e8e..de9822a75 100644 --- a/cli/tsc/dts/lib.dom.d.ts +++ b/cli/tsc/dts/lib.dom.d.ts @@ -11783,6 +11783,7 @@ interface Response extends Body { declare var Response: { prototype: Response; new(body?: BodyInit | null, init?: ResponseInit): Response; + json(data: unknown, init?: ResponseInit): Response; error(): Response; redirect(url: string | URL, status?: number): Response; }; |