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 "bin/builtin.h" | 5 #include "bin/builtin.h" |
6 #include "include/dart_api.h" | 6 #include "include/dart_api.h" |
7 #include "include/dart_mirrors_api.h" | 7 #include "include/dart_mirrors_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/json.h" | 10 #include "platform/json.h" |
(...skipping 5610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5621 url = NewString("library2_dart"); | 5621 url = NewString("library2_dart"); |
5622 source = NewString(kLibrary2Chars); | 5622 source = NewString(kLibrary2Chars); |
5623 Dart_LoadLibrary(url, source); | 5623 Dart_LoadLibrary(url, source); |
5624 | 5624 |
5625 url = NewString("library1_dart"); | 5625 url = NewString("library1_dart"); |
5626 source = NewString(kLibrary1Chars); | 5626 source = NewString(kLibrary1Chars); |
5627 Dart_LoadLibrary(url, source); | 5627 Dart_LoadLibrary(url, source); |
5628 | 5628 |
5629 result = Dart_Invoke(result, NewString("main"), 0, NULL); | 5629 result = Dart_Invoke(result, NewString("main"), 0, NULL); |
5630 EXPECT(Dart_IsError(result)); | 5630 EXPECT(Dart_IsError(result)); |
5631 EXPECT_SUBSTRING("ambiguous reference: 'foo'", Dart_GetError(result)); | 5631 EXPECT_SUBSTRING("NoSuchMethodError", Dart_GetError(result)); |
5632 } | 5632 } |
5633 | 5633 |
5634 | 5634 |
5635 // Test that if the same name is imported from two libraries, it is | 5635 // Test that if the same name is imported from two libraries, it is |
5636 // not an error if that name is not used. | 5636 // not an error if that name is not used. |
5637 TEST_CASE(ImportLibrary4) { | 5637 TEST_CASE(ImportLibrary4) { |
5638 const char* kScriptChars = | 5638 const char* kScriptChars = |
5639 "import 'library2_dart';\n" | 5639 "import 'library2_dart';\n" |
5640 "import 'library1_dart';\n" | 5640 "import 'library1_dart';\n" |
5641 "main() { }\n"; | 5641 "main() { }\n"; |
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7317 NewString("main"), | 7317 NewString("main"), |
7318 0, | 7318 0, |
7319 NULL); | 7319 NULL); |
7320 int64_t value = 0; | 7320 int64_t value = 0; |
7321 result = Dart_IntegerToInt64(result, &value); | 7321 result = Dart_IntegerToInt64(result, &value); |
7322 EXPECT_VALID(result); | 7322 EXPECT_VALID(result); |
7323 EXPECT_EQ(8, value); | 7323 EXPECT_EQ(8, value); |
7324 } | 7324 } |
7325 | 7325 |
7326 } // namespace dart | 7326 } // namespace dart |
OLD | NEW |