2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-01-13 02:51:32 -05:00
|
|
|
|
2022-07-20 04:12:18 -04:00
|
|
|
import {
|
|
|
|
assertEquals,
|
|
|
|
assertNotEquals,
|
|
|
|
assertStringIncludes,
|
|
|
|
} from "./test_util.ts";
|
2021-07-08 09:43:36 -04:00
|
|
|
|
2021-11-23 11:45:18 -05:00
|
|
|
Deno.test(function customInspectFunction() {
|
2023-11-19 03:13:38 -05:00
|
|
|
const exception = new DOMException("test");
|
|
|
|
assertEquals(Deno.inspect(exception), exception.stack);
|
2021-07-08 09:43:36 -04:00
|
|
|
assertStringIncludes(Deno.inspect(DOMException.prototype), "DOMException");
|
|
|
|
});
|
2022-07-20 04:12:18 -04:00
|
|
|
|
|
|
|
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");
|
|
|
|
});
|