Created
June 17, 2012 16:45
-
-
Save kevmoo/2945042 to your computer and use it in GitHub Desktop.
Async crash in Dartium - 8641
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import('dart:html'); | |
#import('dart:isolate'); | |
SendPort sender; | |
ReceivePort receiver; | |
main(){ | |
CanvasElement canvas = document.query("#content"); | |
canvas.on.mouseMove.add(mouse); | |
canvas.on.mouseOut.add(mouse); | |
sender = spawnFunction(childIsolate); | |
receiver = new ReceivePort(); | |
receiver.receive((msg, _) { | |
print('we got a message'); | |
print(msg); | |
}); | |
sender.send("do work please", receiver.toSendPort()); | |
} | |
void mouse(MouseEvent e) { | |
print("mouse!"); | |
print(e); | |
sender.send('mouse!'); | |
} | |
void childIsolate() { | |
//print('hello?'); | |
port.receive((msg, SendPort replyTo) { | |
//print(msg); | |
//print('doing some work'); | |
replyTo.send('yo!'); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<script type="application/dart" src="async_demo.dart"></script> | |
<script src="http://dart.googlecode.com/svn/trunk/dart/client/dart.js"></script> | |
<canvas height='500' id='content' width='500' style='background: blue;'></canvas> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment