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 "vm/compiler.h" | 6 #include "vm/compiler.h" |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_mirrors_api.h" | 8 #include "include/dart_mirrors_api.h" |
9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
10 #include "include/dart_tools_api.h" | 10 #include "include/dart_tools_api.h" |
(...skipping 6691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6702 | 6702 |
6703 TEST_CASE(LoadPatchSignatureMismatch) { | 6703 TEST_CASE(LoadPatchSignatureMismatch) { |
6704 // This tests the sort of APIs with intentional signature mismatches we need | 6704 // This tests the sort of APIs with intentional signature mismatches we need |
6705 // for typed Dart-JavaScript interop where we emulated JavaScript semantics | 6705 // for typed Dart-JavaScript interop where we emulated JavaScript semantics |
6706 // for optional arguments. | 6706 // for optional arguments. |
6707 const char* kLibrary1Chars = | 6707 const char* kLibrary1Chars = |
6708 "library library1_name;"; | 6708 "library library1_name;"; |
6709 const char* kSourceChars = | 6709 const char* kSourceChars = |
6710 "part of library1_name;\n" | 6710 "part of library1_name;\n" |
6711 "external int foo([int x]);\n" | 6711 "external int foo([int x]);\n" |
6712 "class Foo {\n" | 6712 "class Foo<T extends Foo> {\n" |
6713 " external static int addDefault10([int x, int y]);\n" | 6713 " external static int addDefault10([int x, int y]);\n" |
6714 "}"; | 6714 "}"; |
6715 const char* kPatchChars = | 6715 const char* kPatchChars = |
6716 "const _UNDEFINED = const Object();\n" | 6716 "const _UNDEFINED = const Object();\n" |
6717 "@patch foo([x=_UNDEFINED]) => identical(x, _UNDEFINED) ? 42 : x;\n" | 6717 "@patch foo([x=_UNDEFINED]) => identical(x, _UNDEFINED) ? 42 : x;\n" |
6718 "@patch class Foo {\n" | 6718 "@patch class Foo<T> {\n" |
6719 " static addDefault10([x=_UNDEFINED, y=_UNDEFINED]) {\n" | 6719 " static addDefault10([x=_UNDEFINED, y=_UNDEFINED]) {\n" |
6720 " if (identical(x, _UNDEFINED)) x = 10;\n" | 6720 " if (identical(x, _UNDEFINED)) x = 10;\n" |
6721 " if (identical(y, _UNDEFINED)) y = 10;\n" | 6721 " if (identical(y, _UNDEFINED)) y = 10;\n" |
6722 " return x + y;\n" | 6722 " return x + y;\n" |
6723 " }\n" | 6723 " }\n" |
6724 "}"; | 6724 "}"; |
6725 | 6725 |
6726 bool old_flag_value = FLAG_ignore_patch_signature_mismatch; | 6726 bool old_flag_value = FLAG_ignore_patch_signature_mismatch; |
6727 FLAG_ignore_patch_signature_mismatch = true; | 6727 FLAG_ignore_patch_signature_mismatch = true; |
6728 | 6728 |
(...skipping 3487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10216 result = Dart_Invoke(lib, | 10216 result = Dart_Invoke(lib, |
10217 NewString("foozoo"), | 10217 NewString("foozoo"), |
10218 0, | 10218 0, |
10219 NULL); | 10219 NULL); |
10220 EXPECT(Dart_IsError(result)); | 10220 EXPECT(Dart_IsError(result)); |
10221 } | 10221 } |
10222 | 10222 |
10223 #endif // !PRODUCT | 10223 #endif // !PRODUCT |
10224 | 10224 |
10225 } // namespace dart | 10225 } // namespace dart |
OLD | NEW |