From 95c4d97db3a58ef35a3f340cf4c963017370fbb1 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 17 Aug 2023 18:07:06 +0200 Subject: [PATCH] FIX: do not mutate `this.attrs` and `this.actions` (#23125) Prior to this fix we would always re-set `this.attrs` with `this.attrs` when defined, which is both wasteful but also dangerous as `this.attrs` can possibly error when mutated. --- .../javascripts/select-kit/addon/components/select-kit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/select-kit/addon/components/select-kit.js b/app/assets/javascripts/select-kit/addon/components/select-kit.js index 6a8c6207c50..e1d6ab6cb18 100644 --- a/app/assets/javascripts/select-kit/addon/components/select-kit.js +++ b/app/assets/javascripts/select-kit/addon/components/select-kit.js @@ -1127,8 +1127,8 @@ export default Component.extend( }, _deprecateMutations() { - this.actions = this.actions || {}; - this.attrs = this.attrs || {}; + this.actions ??= {}; + this.attrs ??= {}; if (!this.attrs.onChange && !this.actions.onChange) { this._deprecated(