| 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_debugger_api.h" | 7 #include "include/dart_debugger_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 "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 4598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4609 function_name, | 4609 function_name, |
| 4610 0, | 4610 0, |
| 4611 NULL); | 4611 NULL); |
| 4612 EXPECT(Dart_IsError(result)); | 4612 EXPECT(Dart_IsError(result)); |
| 4613 EXPECT(Dart_ErrorHasException(result)); | 4613 EXPECT(Dart_ErrorHasException(result)); |
| 4614 } | 4614 } |
| 4615 | 4615 |
| 4616 | 4616 |
| 4617 TEST_CASE(InvokeNoSuchMethod) { | 4617 TEST_CASE(InvokeNoSuchMethod) { |
| 4618 const char* kScriptChars = | 4618 const char* kScriptChars = |
| 4619 "import 'dart:_collection-dev' as _collection_dev;\n" | 4619 "import 'dart:_internal' as _internal;\n" |
| 4620 "class Expect {\n" | 4620 "class Expect {\n" |
| 4621 " static equals(a, b) {\n" | 4621 " static equals(a, b) {\n" |
| 4622 " if (a != b) {\n" | 4622 " if (a != b) {\n" |
| 4623 " throw 'not equal. expected: $a, got: $b';\n" | 4623 " throw 'not equal. expected: $a, got: $b';\n" |
| 4624 " }\n" | 4624 " }\n" |
| 4625 " }\n" | 4625 " }\n" |
| 4626 "}\n" | 4626 "}\n" |
| 4627 "class TestClass {\n" | 4627 "class TestClass {\n" |
| 4628 " static int fld1 = 0;\n" | 4628 " static int fld1 = 0;\n" |
| 4629 " void noSuchMethod(Invocation invocation) {\n" | 4629 " void noSuchMethod(Invocation invocation) {\n" |
| 4630 " var name = _collection_dev.Symbol.getName(invocation.memberName);\n" | 4630 " var name = _internal.Symbol.getName(invocation.memberName);\n" |
| 4631 " if (name == 'fld') {\n" | 4631 " if (name == 'fld') {\n" |
| 4632 " Expect.equals(true, invocation.isGetter);\n" | 4632 " Expect.equals(true, invocation.isGetter);\n" |
| 4633 " Expect.equals(false, invocation.isMethod);\n" | 4633 " Expect.equals(false, invocation.isMethod);\n" |
| 4634 " Expect.equals(false, invocation.isSetter);\n" | 4634 " Expect.equals(false, invocation.isSetter);\n" |
| 4635 " } else if (name == 'setfld') {\n" | 4635 " } else if (name == 'setfld') {\n" |
| 4636 " Expect.equals(true, invocation.isSetter);\n" | 4636 " Expect.equals(true, invocation.isSetter);\n" |
| 4637 " Expect.equals(false, invocation.isMethod);\n" | 4637 " Expect.equals(false, invocation.isMethod);\n" |
| 4638 " Expect.equals(false, invocation.isGetter);\n" | 4638 " Expect.equals(false, invocation.isGetter);\n" |
| 4639 " } else if (name == 'method') {\n" | 4639 " } else if (name == 'method') {\n" |
| 4640 " Expect.equals(true, invocation.isMethod);\n" | 4640 " Expect.equals(true, invocation.isMethod);\n" |
| (...skipping 3188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7829 NewString("main"), | 7829 NewString("main"), |
| 7830 1, | 7830 1, |
| 7831 dart_args); | 7831 dart_args); |
| 7832 int64_t value = 0; | 7832 int64_t value = 0; |
| 7833 result = Dart_IntegerToInt64(result, &value); | 7833 result = Dart_IntegerToInt64(result, &value); |
| 7834 EXPECT_VALID(result); | 7834 EXPECT_VALID(result); |
| 7835 EXPECT_EQ(6, value); | 7835 EXPECT_EQ(6, value); |
| 7836 } | 7836 } |
| 7837 | 7837 |
| 7838 } // namespace dart | 7838 } // namespace dart |
| OLD | NEW |