Skip to content

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

Closed
@jacob314

Description

@jacob314

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.

Metadata

Metadata

Assignees

Labels

area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-js-interopIssues that impact all js interop

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions