aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/audio.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-15 12:32:45 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-22 14:37:10 -0500
commitcae8ed276799f0171aa8a5d77b908b4a751c98e9 (patch)
treee9911d44058bc6709dd38cb4728a04081c12fbce /ext/bg/js/audio.js
parent1f62dfa572f2eff2a130ef5db7b12bdc2dc7db27 (diff)
Use Array.isArray instead of hasOwn
Diffstat (limited to 'ext/bg/js/audio.js')
-rw-r--r--ext/bg/js/audio.js6
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) {