diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-02-15 12:32:45 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-02-22 14:37:10 -0500 |
commit | cae8ed276799f0171aa8a5d77b908b4a751c98e9 (patch) | |
tree | e9911d44058bc6709dd38cb4728a04081c12fbce | |
parent | 1f62dfa572f2eff2a130ef5db7b12bdc2dc7db27 (diff) |
Use Array.isArray instead of hasOwn
-rw-r--r-- | ext/bg/js/audio.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/bg/js/audio.js b/ext/bg/js/audio.js index 6389528b..0ecfd5c4 100644 --- a/ext/bg/js/audio.js +++ b/ext/bg/js/audio.js @@ -168,10 +168,8 @@ async function audioInject(definition, fields, sources, optionsContext) { } try { - let audioSourceDefinition = definition; - if (hasOwn(definition, 'expressions')) { - audioSourceDefinition = definition.expressions[0]; - } + const expressions = definition.expressions; + const audioSourceDefinition = Array.isArray(expressions) ? expressions[0] : definition; const {url} = await audioGetFromSources(audioSourceDefinition, sources, optionsContext, true); if (url !== null) { |