I'm playing with the WebAudio API in WebCore and am starting out by trying to reproduce some examples I've found online. They invariably all start out like this (in JS):
var audioContext = new AudioContext();
I'm guessing the equivalent in Delphi is:
audioContext := TJSAudioContext.Create;
Here's the class hierarchy I can see:
TJSAudioContext --> TJSBaseAudioContext --> TJSEventTarget --> TObject
So why does the compiler say it cannot find a .Create method? Nor even a .new method. (Well constructors or ... anything!)
In fact, none of the types in the imported class contain constructors, which is quite puzzling.
How are you supposed to create instances of them?
One common type, TJSObject, contains a 'new' constructor.
But there are only a couple of types in the imported WebAudio API library that descend from TJSObject, and they look pretty minor.
What sort of magic incantation is needed to get this to work?
BTW, I'm using Delphi 10.3.3 with the latest WebCore installed, although I get the exact same results in D10.4.