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

Only top level JS annotations should be allowed to contain dots #27926

Closed
jacob314 opened this issue Nov 29, 2016 · 1 comment
Closed

Only top level JS annotations should be allowed to contain dots #27926

jacob314 opened this issue Nov 29, 2016 · 1 comment
Assignees
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. web-js-interop Issues that impact all js interop

Comments

@jacob314
Copy link
Member

The following should generate a static error as the @JS annotation for location is not top level but contains a dot.

@JS('goog.maps')
class Maps {
  @JS('current.loc');
  external static location;
}

If you want to access location as a static you should instead be required to write

@JS('goog.maps.current')
class Current {
  @JS('loc');
  external static location;
}

There isn't much benefit from supporting dot within @JS annotations on static member names the meaning
of static @JS annotations containing dots is confusing.

@jacob314 jacob314 added the web-js-interop Issues that impact all js interop label Nov 29, 2016
@jacob314 jacob314 self-assigned this Nov 29, 2016
@daniel-v
Copy link

Just ran into this. DDC warned me with a link to this issue. Big, big 👍 for properly informing me about it.

@vsmenon vsmenon added the area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. label Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. web-js-interop Issues that impact all js interop
Projects
None yet
Development

No branches or pull requests

3 participants