JohnEarnest / ok

An open-source interpreter for the K5 programming language.
MIT License
585 stars 73 forks source link

ike audio context #102

Closed ktye closed 2 years ago

ktye commented 2 years ago

is that correct? https://github.com/JohnEarnest/ok/blob/gh-pages/ike/audio.js#L45

if (!audio) {
    if (typeof AudioContext !== 'undefined') {
//                              ^^^
        audio = new AudioContext();
    }
    else if (typeof webkitAudioContext !== 'undefined') {
        audio = new webkitAudioContext();
    }
}

shouldn't it be typeof AudioContext === 'undefined' ?

JohnEarnest commented 2 years ago

If the class is not undefined, I want to produce an instance of it.