Skip to content

dart2js needs to implement metadata describing a native field of a native type #4511

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
rakudrama opened this issue Aug 15, 2012 · 7 comments
Assignees

Comments

@rakudrama
Copy link
Member

The html library implementation needs a way to indicate that a DOM class has a field with a Dart name that maps to a JavaScript property with a different name.

  @­JS_NAME('nextSibling') // JavaScript name
  final _NodeImpl nextNode; // Dart name

This is better than the currently available 'inline assembly' version:

  _NodeImpl get nextNode() => JS('_NodeImpl', '#.nextSibling', this);

The declarative metadata form is better because JS() is opaque, so dart2js can't tell that inlining the JS() body is possible on a nullable receiver. Inlining on nullable receivers opens up many more inlining possiblities but is only possible if the inlined code preserves the NullPointerException behaviour.

In addition mapping nextNode to nextSibling, the declarative form tells the compiler that nextSibling exists on native classes so should not be used as the JavaScript member name of any Dart members.

@rakudrama
Copy link
Member Author

Marked this as being blocked by #4058.

@kasperl
Copy link

kasperl commented Sep 3, 2012

Added this to the Later milestone.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Removed this from the Later milestone.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Added this to the M2 milestone.

@peter-ahe-google
Copy link
Contributor

Set owner to @rakudrama.

@peter-ahe-google
Copy link
Contributor

Removed this from the M2 milestone.
Added this to the Later milestone.

@rakudrama
Copy link
Member Author

dart:html now used @­JSName annotations on many fields and methods.


Added Fixed label.

@rakudrama rakudrama self-assigned this Dec 7, 2012
@rakudrama rakudrama added this to the Later milestone Dec 7, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants