Closed skybrian closed 9 years ago
This is likely not a real compiler issue. It's due to how I'm working around bugs in the html library. I'm not using the generated wrappers. Instead I'm using a native function to create a JavaScript object and "cast" it directly to the interface type.
Ah, that makes sense.
If you're using native JS, you might be able to put a block of Dart code after the native, like this: makeFoo() native "... JS code to create a Foo ..."; ... if (false) { // trick compiler to think AudioProcessingEvent is used: AudioProcessingEvent e; e is AudioProcessingEvent; e.inputBuffer; e.outputBuffer; }
I'm not sure if that will work (since AudioProcessingEvent is an interface) but worth a shot.
Added this to the FrogEditor milestone.
The html API generates a bunch of interfaces that are wrappers around JavaScript objects. Many of them have fields. For example:
interface AudioProcessingEvent extends Event { AudioBuffer get inputBuffer(); AudioBuffer get outputBuffer(); }
When I actually try to use any of these fields in Dart, I get an error:
Uncaught TypeError: Object #<AudioProcessingEvent> has no method 'get$outputBuffer'
It appears that frogc is using its own calling convention (calling a method) instead of doing it the native JavaScript way (accessing a field).
(Also, shouldn't this