Chromium Code Reviews| Index: pkg/kernel/testcases/closures/blocks.dart | 
| diff --git a/pkg/kernel/testcases/closures/blocks.dart b/pkg/kernel/testcases/closures/blocks.dart | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..5e694190e073d49a34b5ef42e0fa8521ba83b9c8 | 
| --- /dev/null | 
| +++ b/pkg/kernel/testcases/closures/blocks.dart | 
| @@ -0,0 +1,48 @@ | 
| +/* | 
| + * Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 
| + * for details. All rights reserved. Use of this source code is governed by a | 
| + * BSD-style license that can be found in the LICENSE file. | 
| + */ | 
| 
 
Dmitry Stefantsov
2017/08/24 09:41:13
Please, write a short description of the test here
 
sjindel
2017/08/24 11:11:43
Done.
 
Dmitry Stefantsov
2017/08/24 11:49:57
Thanks!  It would be nice to boil down this test c
 
 | 
| +class X {} | 
| + | 
| +typedef dynamic fn(dynamic x); | 
| +typedef dynamic fn2(dynamic x, dynamic y); | 
| + | 
| +void startIsolateMock( | 
| + dynamic parentPort, | 
| + dynamic entryPoint, | 
| + dynamic args, | 
| + dynamic message, | 
| + dynamic isSpawnUri, | 
| + dynamic controlPort, | 
| + List<dynamic> capabilities) { | 
| + if (controlPort != null) { | 
| + controlPort.handler = (dynamic _) {}; | 
| + } | 
| + if (parentPort != null) { | 
| + dynamic readyMessage = new List<dynamic>(2); | 
| + readyMessage[0] = controlPort.sendPort; | 
| + readyMessage[1] = capabilities; | 
| + capabilities = null; | 
| + parentPort.send(readyMessage); | 
| + } | 
| + assert(capabilities == null); | 
| + dynamic port = "abc"; | 
| + port.handler = (dynamic _) { | 
| + port.close(); | 
| + if (isSpawnUri) { | 
| + if (entryPoint is fn2) { | 
| + entryPoint.call(args, message); | 
| + } else if (entryPoint is fn) { | 
| + entryPoint.call(args); | 
| + } else { | 
| + entryPoint.call(); | 
| + } | 
| + } else { | 
| + entryPoint.call(message); | 
| + } | 
| + }; | 
| + port.sendPort.send(null); | 
| +} | 
| + | 
| +main() {} | 
| 
 
Dmitry Stefantsov
2017/08/24 09:41:13
Also, a comment describing why [main] is empty wou
 
sjindel
2017/08/24 11:11:43
Done.
 
 |