OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'dart:fletch'; | 5 import 'dart:dartino'; |
6 | 6 |
7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
8 import 'package:immutable/immutable.dart'; | 8 import 'package:immutable/immutable.dart'; |
9 | 9 |
10 const List API = const [ | 10 const List API = const [ |
11 const RpcMethod('foo', arity: 0), | 11 const RpcMethod('foo', arity: 0), |
12 const RpcMethod('bar', arity: 0), | 12 const RpcMethod('bar', arity: 0), |
13 const RpcMethod('baz', arity: 1), | 13 const RpcMethod('baz', arity: 1), |
14 const RpcMethod('biz', arity: 1), | 14 const RpcMethod('biz', arity: 1), |
15 ]; | 15 ]; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 Channel replyTo = new Channel(); | 186 Channel replyTo = new Channel(); |
187 command[1] = new Port(replyTo); | 187 command[1] = new Port(replyTo); |
188 _port.send(new LinkedList.fromList(command)); | 188 _port.send(new LinkedList.fromList(command)); |
189 LinkedList reply = replyTo.receive(); | 189 LinkedList reply = replyTo.receive(); |
190 var tag = reply.head; | 190 var tag = reply.head; |
191 var result = reply.tail.head; | 191 var result = reply.tail.head; |
192 if (tag == 1) throw result; | 192 if (tag == 1) throw result; |
193 return result; | 193 return result; |
194 } | 194 } |
195 } | 195 } |
OLD | NEW |