Hej,
I have question on using dart2js. When I try to compile dart2js using dart2js
I end up with an exception when running the generated javascript output.
For compilation I am using:
dart2js --package-root=out/ReleaseX64/packages --categories=Server --library-root=out/ReleaseX64/dart-sdk pkg/compiler/lib/src/dart2js.dart
where out/ReleaseX64 is the built directory for the dart project. This works
well and generates a javascript file, which I atferwards concatenate with the
d8 preamble file:
cat out/ReleaseX64/dart-sdk/lib/_internal/compiler/js_lib/preambles/d8.js >> main.js
cat out.js >> main.js
However, when trying to execute the resulting javascript file afterwards
using nodejs, I get the following exception:
The compiler crashed: Unsupported operation: Platform._operatingSystem
Unsupported operation: Platform._operatingSystem
at dart.wrapException (/home/thomas/Schreibtisch/main.js:3170:15)
at dart._Platform__operatingSystem (/home/thomas/Schreibtisch/main.js:18786:13)
at dart._Platform_operatingSystem (/home/thomas/Schreibtisch/main.js:18798:14)
at t1.fixed$length (/home/thomas/Schreibtisch/main.js:113579:12)
at Isolate.prototype.(anonymous function) (/home/thomas/Schreibtisch/main.js:114206:40)
at t1.fixed$length (/home/thomas/Schreibtisch/main.js:113583:5)
at Isolate.prototype.(anonymous function) (/home/thomas/Schreibtisch/main.js:114206:40)
at dart.uriPathToNative (/home/thomas/Schreibtisch/main.js:50768:12)
at dart.internalMain (/home/thomas/Schreibtisch/main.js:28971:16)
at dart.main (/home/thomas/Schreibtisch/main.js:28965:7)
/home/thomas/Schreibtisch/main.js:263
throw e;
^
Unsupported operation: ProcessUtils._exit
at dart.wrapException (/home/thomas/Schreibtisch/main.js:3170:15)
at dart._ProcessUtils__exit (/home/thomas/Schreibtisch/main.js:18810:13)
at dart.exit (/home/thomas/Schreibtisch/main.js:18813:7)
at internalMain_onError.dart.internalMain_onError.call$2 (/home/thomas/Schreibtisch/main.js:29401:20)
at dart.internalMain (/home/thomas/Schreibtisch/main.js:28980:22)
at dart.main (/home/thomas/Schreibtisch/main.js:28965:7)
at startRootIsolate_closure.dart.startRootIsolate_closure.call$0 (/home/thomas/Schreibtisch/main.js:2052:30)
at _IsolateContext.dart._IsolateContext.eval$1 (/home/thomas/Schreibtisch/main.js:2234:23)
at dart.startRootIsolate (/home/thomas/Schreibtisch/main.js:1911:19)
at /home/thomas/Schreibtisch/main.js:114294:9
I am surely doing something wrong and would appreciate help in pointing out what.
I am using an Ubuntu with dart (revision 4501) and node js v0.10.25 installed.
Thanks a lot and kind regards
Thomas Heinze