diff options
author | Marcos Casagrande <marcoscvp90@gmail.com> | 2020-05-31 22:07:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-31 16:07:24 -0400 |
commit | ecb94c06e94c97ba07b804771f66c5e52c3d83ac (patch) | |
tree | 0646f0c3b94f073f8a4c3a91c2f3d93101a7d9b7 /cli | |
parent | 0ce6394acabdf75bc1d80a399be7ec8e1e08bd49 (diff) |
fix Headers.name and FormData.name (#5994)
Diffstat (limited to 'cli')
-rw-r--r-- | cli/js/web/form_data.ts | 5 | ||||
-rw-r--r-- | cli/js/web/headers.ts | 5 | ||||
-rw-r--r-- | cli/tests/unit/form_data_test.ts | 2 | ||||
-rw-r--r-- | cli/tests/unit/headers_test.ts | 4 |
4 files changed, 15 insertions, 1 deletions
diff --git a/cli/js/web/form_data.ts b/cli/js/web/form_data.ts index 055694517..155f40771 100644 --- a/cli/js/web/form_data.ts +++ b/cli/js/web/form_data.ts @@ -137,3 +137,8 @@ export class FormDataImpl extends DomIterableMixin< FormDataEntryValue, typeof FormDataBase >(FormDataBase, dataSymbol) {} + +Object.defineProperty(FormDataImpl, "name", { + value: "FormData", + configurable: true, +}); diff --git a/cli/js/web/headers.ts b/cli/js/web/headers.ts index d803f69f3..9e0a70f0d 100644 --- a/cli/js/web/headers.ts +++ b/cli/js/web/headers.ts @@ -256,3 +256,8 @@ export class HeadersImpl extends DomIterableMixin< string, typeof HeadersBase >(HeadersBase, headersData) {} + +Object.defineProperty(HeadersImpl, "name", { + value: "Headers", + configurable: true, +}); diff --git a/cli/tests/unit/form_data_test.ts b/cli/tests/unit/form_data_test.ts index f25818eee..89f8ffa0e 100644 --- a/cli/tests/unit/form_data_test.ts +++ b/cli/tests/unit/form_data_test.ts @@ -6,7 +6,7 @@ import { assertStrContains, } from "./test_util.ts"; -unitTest({ ignore: true }, function formDataHasCorrectNameProp(): void { +unitTest(function formDataHasCorrectNameProp(): void { assertEquals(FormData.name, "FormData"); }); diff --git a/cli/tests/unit/headers_test.ts b/cli/tests/unit/headers_test.ts index 6dd60c8c5..722c55fb5 100644 --- a/cli/tests/unit/headers_test.ts +++ b/cli/tests/unit/headers_test.ts @@ -10,6 +10,10 @@ const { // @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol } = Deno[Deno.internal]; +unitTest(function headersHasCorrectNameProp(): void { + assertEquals(Headers.name, "Headers"); +}); + // Logic heavily copied from web-platform-tests, make // sure pass mostly header basic test // ref: https://github.com/web-platform-tests/wpt/blob/7c50c216081d6ea3c9afe553ee7b64534020a1b2/fetch/api/headers/headers-basic.html |