| 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/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
| 8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 Dart_NewString(fname), | 41 Dart_NewString(fname), |
| 42 &bpt); | 42 &bpt); |
| 43 EXPECT_NOT_ERROR(res); | 43 EXPECT_NOT_ERROR(res); |
| 44 } | 44 } |
| 45 | 45 |
| 46 | 46 |
| 47 static Dart_Handle Invoke(const char* func_name) { | 47 static Dart_Handle Invoke(const char* func_name) { |
| 48 ASSERT(script_lib != NULL); | 48 ASSERT(script_lib != NULL); |
| 49 ASSERT(!Dart_IsError(script_lib)); | 49 ASSERT(!Dart_IsError(script_lib)); |
| 50 ASSERT(Dart_IsLibrary(script_lib)); | 50 ASSERT(Dart_IsLibrary(script_lib)); |
| 51 return Dart_InvokeStatic(script_lib, | 51 return Dart_Invoke(script_lib, Dart_NewString(func_name), 0, NULL); |
| 52 Dart_NewString(""), | |
| 53 Dart_NewString(func_name), | |
| 54 0, | |
| 55 NULL); | |
| 56 } | 52 } |
| 57 | 53 |
| 58 | 54 |
| 59 static char const* ToCString(Dart_Handle str) { | 55 static char const* ToCString(Dart_Handle str) { |
| 60 EXPECT(Dart_IsString(str)); | 56 EXPECT(Dart_IsString(str)); |
| 61 char const* c_str = NULL; | 57 char const* c_str = NULL; |
| 62 Dart_StringToCString(str, &c_str); | 58 Dart_StringToCString(str, &c_str); |
| 63 return c_str; | 59 return c_str; |
| 64 } | 60 } |
| 65 | 61 |
| (...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 EXPECT(Dart_IsString(source)); | 966 EXPECT(Dart_IsString(source)); |
| 971 char const* source_chars; | 967 char const* source_chars; |
| 972 Dart_StringToCString(source, &source_chars); | 968 Dart_StringToCString(source, &source_chars); |
| 973 OS::Print("\n=== source: ===\n%s", source_chars); | 969 OS::Print("\n=== source: ===\n%s", source_chars); |
| 974 EXPECT_STREQ(kScriptChars, source_chars); | 970 EXPECT_STREQ(kScriptChars, source_chars); |
| 975 } | 971 } |
| 976 | 972 |
| 977 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 973 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 978 | 974 |
| 979 } // namespace dart | 975 } // namespace dart |
| OLD | NEW |