Index: runtime/vm/custom_isolate_test.cc |
diff --git a/runtime/vm/custom_isolate_test.cc b/runtime/vm/custom_isolate_test.cc |
index d64e8366800542c59233c6f691bd56703f4b8da3..7d43473bcbf1c6be10c83bc37da92a1836c92886 100644 |
--- a/runtime/vm/custom_isolate_test.cc |
+++ b/runtime/vm/custom_isolate_test.cc |
@@ -24,7 +24,7 @@ static Dart_NativeFunction NativeLookup(Dart_Handle name, int argc); |
static const char* kCustomIsolateScriptChars = |
"import 'dart:isolate';\n" |
"\n" |
- "ReceivePort mainPort;\n" |
+ "RawReceivePort mainPort;\n" |
"\n" |
"echo(arg) native \"native_echo\";\n" |
"\n" |
@@ -51,21 +51,23 @@ static const char* kCustomIsolateScriptChars = |
"\n" |
"isolateMain() {\n" |
" echo('Running isolateMain');\n" |
- " mainPort.receive((message, SendPort replyTo) {\n" |
- " echo('Received: $message');\n" |
- " replyTo.send((message + 1), null);\n" |
- " });\n" |
+ " mainPort.handler = (message) {\n" |
+ " var data = message[0];\n" |
+ " var replyTo = message[1];\n" |
+ " echo('Received: $data');\n" |
+ " replyTo.send(data + 1);\n" |
+ " };\n" |
"}\n" |
"\n" |
"main() {\n" |
" var isolate = new CustomIsolate(\"isolateMain\");\n" |
- " var receivePort = new ReceivePort();\n" |
+ " var receivePort = new RawReceivePort();\n" |
" SendPort port = isolate.spawn();\n" |
- " port.send(42, receivePort.toSendPort());\n" |
- " receivePort.receive((message, _) {\n" |
+ " port.send([42, receivePort.sendPort]);\n" |
+ " receivePort.handler = (message) {\n" |
" receivePort.close();\n" |
" echo('Received: $message');\n" |
- " });\n" |
+ " };\n" |
" return 'success';\n" |
"}\n"; |