source: frontend/node_modules/domexception/lib/DOMException-impl.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 585 bytes
RevLine 
[9af201e]1"use strict";
2const legacyErrorCodes = require("./legacy-error-codes.json");
3const idlUtils = require("./utils.js");
4
5exports.implementation = class DOMExceptionImpl {
6 constructor(globalObject, [message, name]) {
7 this.name = name;
8 this.message = message;
9 }
10
11 get code() {
12 return legacyErrorCodes[this.name] || 0;
13 }
14};
15
16// A proprietary V8 extension that causes the stack property to appear.
17exports.init = impl => {
18 if (Error.captureStackTrace) {
19 const wrapper = idlUtils.wrapperForImpl(impl);
20 Error.captureStackTrace(wrapper, wrapper.constructor);
21 }
22};
Note: See TracBrowser for help on using the repository browser.