-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dart2js
Description
dart2js
and DDC stringify closures differently from the Dart VM. To avoid "browser quirks" in Flutter for web, we'd like the behavior to be consistent.
Example:
void main() {
print(() {});
print(fn);
}
void fn() {}
The Dart VM prints:
$ dart print_closure.dart
Closure: () => Null
Closure: () => void from Function 'fn': static.
dart2js output prints:
$ node out.js
Closure 'main_closure'
Closure 'fn'
Dart SDK info:
$ dart --version
Dart VM version: 2.3.1 (Tue May 21 19:28:38 2019 +0200) on "linux_x64"
$ dart2js --version
Dart-to-JavaScript compiler (dart2js) version: 2.3.1
I haven't tried DDC (I don't know how to use it from the command line), but I'm guessing it's not consistent either.
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dart2js