diff options
author | Phosra <phosra@tutanota.com> | 2022-07-20 01:12:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-20 10:12:18 +0200 |
commit | b8e1250500ba07971b2f05847fdcbbfe548caa44 (patch) | |
tree | 8eaac48eb6f14e279120cdd81cf58c510bf640f8 /cli/tests/unit/dom_exception_test.ts | |
parent | 2b1f145c3e51cf9885c073b78bd5882e80d258e3 (diff) |
fix(ext/web): align DOMException better with spec (#15097)
Diffstat (limited to 'cli/tests/unit/dom_exception_test.ts')
-rw-r--r-- | cli/tests/unit/dom_exception_test.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cli/tests/unit/dom_exception_test.ts b/cli/tests/unit/dom_exception_test.ts index 01f7b5db5..b6b6a4440 100644 --- a/cli/tests/unit/dom_exception_test.ts +++ b/cli/tests/unit/dom_exception_test.ts @@ -1,4 +1,8 @@ -import { assertEquals, assertStringIncludes } from "./test_util.ts"; +import { + assertEquals, + assertNotEquals, + assertStringIncludes, +} from "./test_util.ts"; Deno.test(function customInspectFunction() { const blob = new DOMException("test"); @@ -8,3 +12,13 @@ Deno.test(function customInspectFunction() { ); assertStringIncludes(Deno.inspect(DOMException.prototype), "DOMException"); }); + +Deno.test(function nameToCodeMappingPrototypeAccess() { + const newCode = 100; + const objectPrototype = Object.prototype as unknown as { + pollution: number; + }; + objectPrototype.pollution = newCode; + assertNotEquals(newCode, new DOMException("test", "pollution").code); + Reflect.deleteProperty(objectPrototype, "pollution"); +}); |