Michael Bullington
2015-07-06 18:46:18 UTC
Hello!
I'm currently working (finishing up) a project that makes Dart libraries usable from JS. You can find the project here <https://www.github.com/dglogik/calzone.dart>, documentation is lacking at the moment. The main project using it right now is sdk-dslink-javascript, an updated JavaScript SDK for the IoT DSA platform. The IoT DSA platform was shown earlier this year at the Dart Summit.
I'm attempting to create some mirror code that will keep everything needed for the code to function dynamically from JavaScript, and here is my progress so far.
main(List<String> args) {
var a = new Symbol(args.length.toString());
reflectClass(a).getField(a);
reflectClass(a).invoke(a, []);
currentMirrorSystem().findLibrary(a).getField(a);
}
With this code (along with @MirrorsUsed for slightly less output), all classes, methods, and functions are retained. However, static fields are not retained in the dart2js output (for classes or libraries). Mangled name definitions are generated for them, but the resulting name doesn't link to any actual value.
Is there a way to make dart2js keep the value of the fields also in it's output? Any help or general direction would be appreciated, thank you.
Michael Bullington
I'm currently working (finishing up) a project that makes Dart libraries usable from JS. You can find the project here <https://www.github.com/dglogik/calzone.dart>, documentation is lacking at the moment. The main project using it right now is sdk-dslink-javascript, an updated JavaScript SDK for the IoT DSA platform. The IoT DSA platform was shown earlier this year at the Dart Summit.
I'm attempting to create some mirror code that will keep everything needed for the code to function dynamically from JavaScript, and here is my progress so far.
main(List<String> args) {
var a = new Symbol(args.length.toString());
reflectClass(a).getField(a);
reflectClass(a).invoke(a, []);
currentMirrorSystem().findLibrary(a).getField(a);
}
With this code (along with @MirrorsUsed for slightly less output), all classes, methods, and functions are retained. However, static fields are not retained in the dart2js output (for classes or libraries). Mangled name definitions are generated for them, but the resulting name doesn't link to any actual value.
Is there a way to make dart2js keep the value of the fields also in it's output? Any help or general direction would be appreciated, thank you.
Michael Bullington
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.