From ba7b9975c5d757d6b61a7cb115ff1da5e03d50b2 Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Fri, 17 Feb 2023 10:44:58 +0000 Subject: [PATCH] [FIX] web: regex syntax unsupported by Webkit Positive Lookbehind regex syntax is currently not supported yet by Webkit, and thus Safari (both on macOS and iOS) resulting into a crash as the syntax is not recognized. This issue affects both frontend and backend. This commit fixes it by reimplementing the feature without using this syntax. closes odoo/odoo#112985 Signed-off-by: Bruno Boi (boi) --- addons/web/static/src/core/utils/draggable_hook_builder.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/web/static/src/core/utils/draggable_hook_builder.js b/addons/web/static/src/core/utils/draggable_hook_builder.js index 2667cab0e9a..12294c20299 100644 --- a/addons/web/static/src/core/utils/draggable_hook_builder.js +++ b/addons/web/static/src/core/utils/draggable_hook_builder.js @@ -107,10 +107,7 @@ const elCache = {}; * @returns {string} */ function camelToKebab(str) { - return str.replaceAll( - /(?<=.)[A-Z]|[A-Z]/g, - (match, prev) => `${prev ? "-" : ""}${match.toLowerCase()}` - ); + return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); } /**