summaryrefslogtreecommitdiff
path: root/ext/web/01_dom_exception.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/web/01_dom_exception.js')
-rw-r--r--ext/web/01_dom_exception.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/web/01_dom_exception.js b/ext/web/01_dom_exception.js
index c6f60ae2f..0d9e82c56 100644
--- a/ext/web/01_dom_exception.js
+++ b/ext/web/01_dom_exception.js
@@ -11,6 +11,8 @@
((window) => {
const {
+ ArrayPrototypeSlice,
+ Error,
ErrorPrototype,
ObjectDefineProperty,
ObjectEntries,
@@ -94,6 +96,16 @@
context: "Argument 2",
});
this.#code = nameToCodeMapping[this.#name] ?? 0;
+
+ // `DOMException` does not have `.stack`, so `Error.prepareStackTrace()`
+ // is not called on it, meaning our structured stack trace hack doesn't
+ // apply. This patches it in.
+ const error = new Error();
+ error.stack;
+ ObjectDefineProperty(this, "__callSiteEvals", {
+ value: ArrayPrototypeSlice(error.__callSiteEvals, 1),
+ configurable: true,
+ });
}
get message() {