Skip to content
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

Capability: Access metadata #3

Closed
seaneagan opened this issue Feb 26, 2015 · 1 comment
Closed

Capability: Access metadata #3

seaneagan opened this issue Feb 26, 2015 · 1 comment

Comments

@seaneagan
Copy link

For dart2js there will be the desire to control which metadata is retained. The most useful way to filter is probably by the Type of the metadata items.

I am particularly hoping that doc-comments can be encoded as metadata as well, see:

http://dartbug.com/15704

So I could specify I want to retain Comments for example.

@eernstg
Copy link
Collaborator

eernstg commented Mar 11, 2015

Please see #6 on dartbug 15704 for some additional information. Reflectable mirrors are intended to be very similar to mirrors from dart:mirrors, so they should agree on the treatment of doc comments.

However, this feature can be implemented independently in dart:mirrors and in Reflectable for post-transform code (whereas pre-transform code in Reflectable relies on dart:mirrors), so I added a reminder in the code to include comments in metadata of DeclarationMirror.

Currently dart:mirrors mirrors do not include doc (or other) comment mirrors in the metadata, but when they do that, there may be a need to adjust the semantics for precise alignment among dart:mirrors and Reflectable. (As an extreme example of this, the outcome may even be that it is decided that dart:mirrors should not support comments as metadata, for backward compatibility or whatever, in which case Reflectable may have to align with the lack of support). In any case, there will be a "temporary feature, do not rely on this in production code" flag on this feature for now.

Also note that the implementation of Reflectable is still highly incomplete, so it will not yet be possible to try it out at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants