fix(core): error registration could pollute constructors (#10422)

Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
This commit is contained in:
Aaron O'Mullan 2021-05-03 17:30:41 +02:00 committed by GitHub
parent 7bc03523d0
commit d21380728f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 85 additions and 15 deletions

View file

@ -184,10 +184,10 @@ delete Object.prototype.__proto__;
core.registerErrorClass("Http", errors.Http);
core.registerErrorClass("Busy", errors.Busy);
core.registerErrorClass("NotSupported", errors.NotSupported);
core.registerErrorClass(
core.registerErrorBuilder(
"DOMExceptionOperationError",
function DOMExceptionOperationError(msg) {
DOMException.prototype.constructor.call(this, msg, "OperationError");
return new DOMException(msg, "OperationError");
},
);
}