OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "platform/globals.h" | 5 #include "platform/globals.h" |
6 | 6 |
7 #include "include/dart_debugger_api.h" | 7 #include "include/dart_debugger_api.h" |
8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 | 555 |
556 // Retained by single instance. | 556 // Retained by single instance. |
557 service_msg = Eval(lib, | 557 service_msg = Eval(lib, |
558 "[port, ['objects', '$validId', 'retained'], [], []]"); | 558 "[port, ['objects', '$validId', 'retained'], [], []]"); |
559 Service::HandleIsolateMessage(isolate, service_msg); | 559 Service::HandleIsolateMessage(isolate, service_msg); |
560 handler.HandleNextMessage(); | 560 handler.HandleNextMessage(); |
561 handler.filterMsg("name"); | 561 handler.filterMsg("name"); |
562 ExpectSubstringF(handler.msg(), | 562 ExpectSubstringF(handler.msg(), |
563 "\"id\":\"objects\\/int-%" Pd "\"", | 563 "\"id\":\"objects\\/int-%" Pd "\"", |
564 arr.raw()->Size() + arr.At(0)->Size()); | 564 arr.raw()->Size() + arr.At(0)->Size()); |
| 565 |
| 566 // eval against list containing an internal object. |
| 567 Object& internal_object = Object::Handle(); |
| 568 internal_object = LiteralToken::New(); |
| 569 arr.SetAt(0, internal_object); |
| 570 service_msg = Eval(lib, |
| 571 "[port, ['objects', '$validId', 'eval'], " |
| 572 "['expr'], ['toString()']]"); |
| 573 Service::HandleIsolateMessage(isolate, service_msg); |
| 574 handler.HandleNextMessage(); |
| 575 ExpectSubstringF(handler.msg(), "\"type\":\"Error\""); |
| 576 ExpectSubstringF( |
| 577 handler.msg(), |
| 578 "\"message\":\"attempt to evaluate against internal VM object\\n\""); |
565 } | 579 } |
566 | 580 |
567 | 581 |
568 TEST_CASE(Service_Libraries) { | 582 TEST_CASE(Service_Libraries) { |
569 const char* kScript = | 583 const char* kScript = |
570 "var port;\n" // Set to our mock port by C++. | 584 "var port;\n" // Set to our mock port by C++. |
571 "var libVar = 54321;\n" | 585 "var libVar = 54321;\n" |
572 "\n" | 586 "\n" |
573 "main() {\n" | 587 "main() {\n" |
574 "}"; | 588 "}"; |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 service_msg = Eval(h_lib, "[port, ['profile'], ['tags'], ['hidden']]"); | 1419 service_msg = Eval(h_lib, "[port, ['profile'], ['tags'], ['hidden']]"); |
1406 Service::HandleIsolateMessage(isolate, service_msg); | 1420 Service::HandleIsolateMessage(isolate, service_msg); |
1407 handler.HandleNextMessage(); | 1421 handler.HandleNextMessage(); |
1408 // Expect error. | 1422 // Expect error. |
1409 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); | 1423 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); |
1410 } | 1424 } |
1411 | 1425 |
1412 #endif // !defined(TARGET_ARCH_ARM64) | 1426 #endif // !defined(TARGET_ARCH_ARM64) |
1413 | 1427 |
1414 } // namespace dart | 1428 } // namespace dart |
OLD | NEW |