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

dart2js mirrors: metadata missing from some variables in a variable declaration #11908

Closed
jmesserly opened this issue Jul 19, 2013 · 10 comments
Closed
Assignees
Labels
closed-obsolete Closed as the reported issue is no longer relevant library-mirrors P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@jmesserly
Copy link

I think this is a dart2js issue but not 100% sure. Consider the following program:


import 'dart:mirrors';

main() {
  for (var field in reflect(new FooBar()).type.variables.values) {
    print('field ${field.simpleName} has metadata '
        '${field.metadata.map((m) => m.reflectee).join()}');
  }
}

const hello = 'hello';

class FooBar {
  @­hello var x, y, z;
}


On VM it prints:

field Symbol("y") has metadata hello
field Symbol("x") has metadata hello
field Symbol("z") has metadata hello

On dart2js+d8 it prints:

field Symbol("x") has metadata hello
field Symbol("y") has metadata
field Symbol("z") has metadata

Note that "y" and "z" are missing metadata.

Since you can only specify metadata on the declaredIdentifier in the variableDeclaration (http://www.dartlang.org/docs/spec/latest/dart-language-specification.html#h.55kzc4r0q21p) , it makes me think metadata should apply to all of the identifiers.

@peter-ahe-google
Copy link
Contributor

I really dislike the legacy syntax ;-)


Removed Area-Library label.
Added Area-Dart2JS, Accepted labels.

@peter-ahe-google
Copy link
Contributor

Set owner to @peter-ahe-google.

@peter-ahe-google
Copy link
Contributor

Marked this as blocking #6490.

@kasperl
Copy link

kasperl commented Sep 18, 2013

Added this to the M7 milestone.

@kasperl
Copy link

kasperl commented Sep 30, 2013

Removed Priority-Unassigned label.
Added Priority-Medium label.

@kasperl
Copy link

kasperl commented Oct 2, 2013

Removed this from the M7 milestone.
Added this to the M8 milestone.

@kasperl
Copy link

kasperl commented Jun 4, 2014

Removed this from the M8 milestone.
Added this to the 1.6 milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the 1.6 milestone.
Added Oldschool-Milestone-1.6 label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-1.6 label.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed accepted labels Feb 29, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Mar 3, 2018
@matanlurey
Copy link
Contributor

Mirrors is no longer supported in Dart2JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant library-mirrors P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

5 participants