From d21380728f7d16f1a5b7362b2e2b5c46ff8a8070 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Mon, 3 May 2021 17:30:41 +0200 Subject: fix(core): error registration could pollute constructors (#10422) Co-authored-by: Luca Casonato --- runtime/js/99_main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/js') diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index d2626a07d..8d75ea739 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -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"); }, ); } -- cgit v1.2.3