Skip to content

frogc doesn't work with fields on interfaces that wrap native JavaScript objects #763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
skybrian opened this issue Dec 8, 2011 · 6 comments
Labels
closed-invalid Closed as we don't believe the reported issue is generally actionable
Milestone

Comments

@skybrian
Copy link

skybrian commented Dec 8, 2011

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

@jmesserly
Copy link

I'm guessing fields aren't using the hidden native convention.


Added Area-Frog label.

@skybrian
Copy link
Author

skybrian commented Dec 8, 2011

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.

@jmesserly
Copy link

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.

@DartBot
Copy link

DartBot commented Dec 9, 2011

This comment was originally written by [email protected]


Added Triaged label.

@dgrove
Copy link
Contributor

dgrove commented Dec 16, 2011

Added this to the FrogEditor milestone.

@jmesserly
Copy link

based on comments above, I don't think this was a real compiler issue.


Added Invalid label.

@skybrian skybrian added Type-Defect closed-invalid Closed as we don't believe the reported issue is generally actionable labels Dec 20, 2011
@skybrian skybrian added this to the FrogEditor milestone Dec 20, 2011
copybara-service bot pushed a commit that referenced this issue Oct 18, 2022
…ions)

https://dart.googlesource.com/protobuf/+log/1d175bef6043..ba29983968de

2022-10-18 [email protected] protoc_plugin: Reword some of the documentation (#766)
2022-10-18 [email protected] protoc_plugin: Improve "is map field" check (#765)
2022-10-18 [email protected] Update CHANGELOG: mention #751
2022-10-18 [email protected] Add CHANGELOG entry for #760, #763
2022-10-18 [email protected] Fix `null` handling in proto3 JSON deserializer (#763)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-protobuf-dart-sdk
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Protobuf Support: https://github.com/dart-lang/protobuf/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: [email protected]
Change-Id: I5502c8ee170701888956534cbd92473a24435fea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264664
Reviewed-by: Nate Bosch <[email protected]>
Commit-Queue: Nate Bosch <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-invalid Closed as we don't believe the reported issue is generally actionable
Projects
None yet
Development

No branches or pull requests

4 participants