spawnFunction does not work when compiled to JavaScript #9493
Labels
closed-duplicate
Closed in favor of an existing report
P1
A high priority bug; for example, a single project is unusable or has many test failures
web-dart2js
Milestone
Consider this code:
import 'dart:html';
import 'dart:isolate';
void main() {
var elem = query("#sample_text_id");
var port = spawnFunction(runInIsolate);
port.call('go!').then((msg) => elem.text = msg);
}
runInIsolate() {
port.receive((msg, SendPort replyTo) {
replyTo.send('hello from isolate');
});
}
This works in Dartium, but not when compiled to dart2js
I've attached the necessary files. Please unzip and then run 'pub install' to clean up all the symlinks.
Using Dart Editor version 0.4.3_r20515
When I open the console in Chrome, I see:
Uncaught ReferenceError: window is not defined
Attachment:
spawnStuff.zip (47.94 KB)
The text was updated successfully, but these errors were encountered: