Description
Consider this program:
import 'dart:isolate';
import 'dart:html' show HttpRequest;
useHttpRequest() {
print('In isolate.');
HttpRequest.getString('test.dart').then((text) => print(text));
}
main() {
print('Starting isolate');
spawnFunction(useHttpRequest);
}
All that shows up in the console is:
"Starting isolate undefined:1"
I had expected to see:
"Starting isolate test.dart:10
[From isolate] In isolate. test.dart:5
[From isolate] DOM access is not enabled in this isolate
0 HttpRequest._create (file:///Volumes/data/b/build/slave/dartium-mac-inc/build/src/out/Release/gen/webkit/bindings/dart/dart/html/HttpRequest.dart:60:3)
1 HttpRequest.HttpRequest (file:///Volumes/data/b/build/slave/dartium-mac-inc/build/src/out/Release/gen/webkit/bindings/dart/dart/html/HttpRequest.dart:58:35)
2 HttpRequest.request (file:///Volumes/data/b/build/slave/dartium-mac-inc/build/src/out/Release/gen/webkit/bindings/dart/dart/html/HttpRequest.dart:10:15)
3 HttpRequest.getString (file:///Volumes/data/b/build/slave/dartium-mac-inc/build/src/out/Release/gen/webkit/bindings/dart/dart/html/HttpRequest.dart:5:19)
4 useHttpRequest (http://127.0.0.1:56653/web_editor/test.dart:6:26)
This is almost what happens if I modify useHttpRequest:
useHttpRequest() {
print('In isolate.');
try {
HttpRequest.getString('test.dart').then((text) => print(text));
} catch (e, trace) {
print('$e\n$trace');
}
}
So the following questions arise:
- Why isn't the the text "In isolate" printed in the console?
- Why isn't the uncaught exception diagnosed?
- Why doesn't the debugger pause on the exception?
- Why does the console say "undefined:1"?
I'll file a separate bug about HttpRequest not being available.