From e46a802e1d31657b741e25fc9608ec85cfee9ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Bu=C5=82at?= Date: Thu, 9 Jan 2020 12:23:53 +0100 Subject: [PATCH] Replace JS eval with split/reduce call In default CSP setup `eval` is disabled. The code can be easily replaced by split/reduce keeping the logic but avoiding `eval`. --- priv/js/react_phoenix.js | 2 +- src/react_phoenix.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/priv/js/react_phoenix.js b/priv/js/react_phoenix.js index ed03754..680bd78 100644 --- a/priv/js/react_phoenix.js +++ b/priv/js/react_phoenix.js @@ -1 +1 @@ -"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var a=0;a { return acc[el] }, window); + const reactElement = React.createElement(reactClass, JSON.parse(reactProps)) ReactDOM.render(reactElement, targetDiv) }) }