this is the transpiled javascript:
Code: Select all
function f_initaudio() {
var v_audio=0;
const AudioContext = window.AudioContext || window.webkitAudioContext
const v_audio = new AudioContext()
if (1) return v_audio;
return 0;
}
As you can see, SpiderBasic has added a
at the beginning of f_initaudio() because you did not specify it yourself. The corresponding error message is therefore
Uncaught SyntaxError: Identifier 'v_audio' has already been declared
because you try to declare v_audio as const.
This is what the correct function would look like:
Code: Select all
Procedure initAudio()
Protected audio
! const AudioContext = window.AudioContext || window.webkitAudioContext
! v_audio = new AudioContext()
ProcedureReturn audio
EndProcedure
This would not have happened with
EnableExplicit. Should always be used.