File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 33const {
44 Error,
55 ErrorPrototype,
6+ FunctionPrototype,
67 ObjectDefineProperties,
78 ObjectDefineProperty,
89 ObjectSetPrototypeOf,
@@ -49,10 +50,15 @@ const disusedNamesSet = new SafeSet()
4950 . add ( 'NoDataAllowedError' )
5051 . add ( 'ValidationError' ) ;
5152
52- class DOMException {
53+ // The DOMException class must not inherit from the Error class,
54+ // but its instance inherit from Error.prototype.
55+ // Make the runtime aware not to allocate `this` instance unnecessarily.
56+ class DOMException extends Error {
57+ static {
58+ ObjectSetPrototypeOf ( DOMException , FunctionPrototype ) ;
59+ }
60+
5361 constructor ( message = '' , options = 'Error' ) {
54- // The DOMException class must not inherit from the Error class,
55- // but its instance inherit from Error.prototype.
5662 // The stack property and [[ErrorData]] internal slot are given.
5763 const error = ReflectConstruct ( Error , [ ] , new . target ) ;
5864
You can’t perform that action at this time.
0 commit comments