Skip to content

[js_interop] No error if a local variable or function is annotated with JSExport() #61093

@sgrekhov

Description

@sgrekhov

No expected errors in the test below on dart2js.

import 'dart:js_interop';

void main() {
  @JSExport()
  int variable = 42;
//    ^^^^^^^^
// [analyzer] unspecified
// [web] unspecified

  @JSExport()
  void func() {}
//     ^^^^
// [analyzer] unspecified
// [web] unspecified
}

cc @srujzs

Dart SDK version: 3.9.0-edge.55523e53df6f5ec1e9dad382d370cc8fd7262aeb (main) (Thu Jul 10 00:02:13 2025 -0700) on "linux_x64"

UPD. The test above passes on dart2wasm but fails on dart2js. Probably it is the same test.py issue as #61084

Metadata

Metadata

Assignees

No one assigned

    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

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions