fix(fetch): make prototype properties writable (#10769)

This commit is contained in:
Luca Casonato 2021-05-26 23:44:42 +02:00 committed by GitHub
parent e5beb800c9
commit d5d59bb794
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 23 deletions

View file

@ -1139,3 +1139,13 @@ unitTest(
assertEquals(actual, expected);
},
);
unitTest({}, function fetchWritableRespProps(): void {
const original = new Response("https://deno.land", {
status: 404,
headers: { "x-deno": "foo" },
});
const new_ = new Response("https://deno.land", original);
assertEquals(original.status, new_.status);
assertEquals(new_.headers.get("x-deno"), "foo");
});