summaryrefslogtreecommitdiff
path: root/cli/tests/unit/dom_exception_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/dom_exception_test.ts')
-rw-r--r--cli/tests/unit/dom_exception_test.ts16
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");
+});