Skip to content

Commit 94c635e

Browse files
authored
Fixed closure compiled output for safari (#290)
1 parent 71a8ac7 commit 94c635e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/audio/gbchannel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ export default class GbChannelWebAudio {
4848
this.audioContext = new (window.AudioContext || window.webkitAudioContext)();
4949

5050
// Set up our nodes
51-
if (this.audioContext) {
51+
// Seems like closure compiler will optimize this out
52+
// Thus, need to do a very specifc type check if statement here.
53+
if (!!this.audioContext === true) {
5254
this.gainNode = this.audioContext.createGain();
5355
}
5456
}

0 commit comments

Comments
 (0)