about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorNolan Lawson <nolan@nolanlawson.com>2017-10-29 08:23:38 -0700
committerunarist <m.unarist@gmail.com>2017-10-30 00:23:38 +0900
commit2cea4592a3fe0164d3a4dd2ff1a2ddf5afee1c31 (patch)
tree53ffac6424fb6cd346e19cba854ceb6b247da6b4 /app/javascript
parent512feab222932875a334cc618464810d05082ed9 (diff)
Avoid modifying emoji data inline (#5548)
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/features/emoji/emoji_compressed.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/emoji/emoji_compressed.js b/app/javascript/mastodon/features/emoji/emoji_compressed.js
index c0cba952a..e5b834a74 100644
--- a/app/javascript/mastodon/features/emoji/emoji_compressed.js
+++ b/app/javascript/mastodon/features/emoji/emoji_compressed.js
@@ -64,14 +64,14 @@ Object.keys(emojiMap).forEach(key => {
 
 Object.keys(emojiIndex.emojis).forEach(key => {
   const { native } = emojiIndex.emojis[key];
-  const { short_names, search, unified } = emojiMartData.emojis[key];
+  let { short_names, search, unified } = emojiMartData.emojis[key];
   if (short_names[0] !== key) {
     throw new Error('The compresser expects the first short_code to be the ' +
       'key. It may need to be rewritten if the emoji change such that this ' +
       'is no longer the case.');
   }
 
-  short_names.splice(0, 1); // first short name can be inferred from the key
+  short_names = short_names.slice(1); // first short name can be inferred from the key
 
   const searchData = [native, short_names, search];
   if (unicodeToUnifiedName(native) !== unified) {