diff options
author | ud2 <sjx233@qq.com> | 2024-06-05 07:09:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-05 01:09:13 +0200 |
commit | 29a075de2b625e1c893f6fad163a6d6937894a7a (patch) | |
tree | bb820ec7ea3b7de99d36618408f9cbba84641390 /tests/unit/dom_exception_test.ts | |
parent | 32f655db540a1d1368162f820e17585911c04c27 (diff) |
chore(ext/web): use `Error.captureStackTrace` in `DOMException` constructor (#23986)
This makes `DOMException`'s `stack` property behave the same as native
errors' – `stack` is now an own accessor property on every instance, and
the getter calls `Error.prepareStackTrace`.
Upgrades `deno_core` to 0.284.0.
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Diffstat (limited to 'tests/unit/dom_exception_test.ts')
-rw-r--r-- | tests/unit/dom_exception_test.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/unit/dom_exception_test.ts b/tests/unit/dom_exception_test.ts index 806248caa..4e894f5fc 100644 --- a/tests/unit/dom_exception_test.ts +++ b/tests/unit/dom_exception_test.ts @@ -23,8 +23,10 @@ Deno.test(function nameToCodeMappingPrototypeAccess() { Reflect.deleteProperty(objectPrototype, "pollution"); }); -Deno.test(function callSitesEvalsDoesntThrow() { +Deno.test(function hasStackAccessor() { const e2 = new DOMException("asdf"); - // @ts-ignore no types for `__callSiteEvals` but it's observable. - assert(Array.isArray(e2.__callSiteEvals)); + const desc = Object.getOwnPropertyDescriptor(e2, "stack"); + assert(desc); + assert(typeof desc.get === "function"); + assert(typeof desc.set === "function"); }); |