This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Description
Dart will not compile executable code left in the root of a document. To match semantics with Dart, it would be nice if ts2dart moved all root executable lines into a main(){} function.
Example:
class angular {
static bootstrap(root: Node, m: string[]) {}
}
class App {
static module = { name: "app"};
}
angular.bootstrap(document, [App.module.name]);
After passing through ts2dart becomes (edited for readability):
var document = 'foo' ;
class angular {
static bootstrap( String s , List < String > m ) { }
}
class App {
static var module = {
"name": "App"
};
}
angular . bootstrap ( document , [ App . module . name ] ) ;
The last line calling angular.bootstrap throws several compiler warning in Dart, as Dart expects this to be a declaration, not an invocation. If ts2dart put that in a main(){}, that would be a Good Thing(tm).