| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_message.h" | 10 #include "vm/dart_api_message.h" |
| (...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 // Create a native port for posting from C to Dart | 1452 // Create a native port for posting from C to Dart |
| 1453 TestIsolateScope __test_isolate__; | 1453 TestIsolateScope __test_isolate__; |
| 1454 const char* kScriptChars = | 1454 const char* kScriptChars = |
| 1455 "#import('dart:isolate');\n" | 1455 "#import('dart:isolate');\n" |
| 1456 "void main() {\n" | 1456 "void main() {\n" |
| 1457 " var messageCount = 0;\n" | 1457 " var messageCount = 0;\n" |
| 1458 " var exception = '';\n" | 1458 " var exception = '';\n" |
| 1459 " var port = new ReceivePort();\n" | 1459 " var port = new ReceivePort();\n" |
| 1460 " port.receive((message, replyTo) {\n" | 1460 " port.receive((message, replyTo) {\n" |
| 1461 " if (messageCount < 7) {\n" | 1461 " if (messageCount < 7) {\n" |
| 1462 " exception += message.toString();\n" | 1462 " exception = '$exception${message}';\n" |
| 1463 " } else {\n" | 1463 " } else {\n" |
| 1464 " exception += message.length;\n" | 1464 " exception = '$exception${message.length}';\n" |
| 1465 " for (int i = 0; i < message.length; i++) {\n" | 1465 " for (int i = 0; i < message.length; i++) {\n" |
| 1466 " exception += message[i];\n" | 1466 " exception = '$exception${message[i]}';\n" |
| 1467 " }\n" | 1467 " }\n" |
| 1468 " }\n" | 1468 " }\n" |
| 1469 " messageCount++;\n" | 1469 " messageCount++;\n" |
| 1470 " if (messageCount == 8) throw new Exception(exception);\n" | 1470 " if (messageCount == 8) throw new Exception(exception);\n" |
| 1471 " });\n" | 1471 " });\n" |
| 1472 " return port.toSendPort();\n" | 1472 " return port.toSendPort();\n" |
| 1473 "}\n"; | 1473 "}\n"; |
| 1474 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); | 1474 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); |
| 1475 Dart_EnterScope(); | 1475 Dart_EnterScope(); |
| 1476 | 1476 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1538 EXPECT(Dart_ErrorHasException(result)); | 1538 EXPECT(Dart_ErrorHasException(result)); |
| 1539 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", | 1539 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", |
| 1540 Dart_GetError(result)); | 1540 Dart_GetError(result)); |
| 1541 | 1541 |
| 1542 Dart_ExitScope(); | 1542 Dart_ExitScope(); |
| 1543 } | 1543 } |
| 1544 | 1544 |
| 1545 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 1545 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 1546 | 1546 |
| 1547 } // namespace dart | 1547 } // namespace dart |
| OLD | NEW |