| 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_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "platform/json.h" | 7 #include "platform/json.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 5905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5916 Dart_Handle script_url = NewString("theScript"); | 5916 Dart_Handle script_url = NewString("theScript"); |
| 5917 source = NewString(kScriptChars); | 5917 source = NewString(kScriptChars); |
| 5918 Dart_Handle test_script = Dart_LoadScript(script_url, source, 0, 0); | 5918 Dart_Handle test_script = Dart_LoadScript(script_url, source, 0, 0); |
| 5919 EXPECT_VALID(test_script); | 5919 EXPECT_VALID(test_script); |
| 5920 | 5920 |
| 5921 // Make sure that we can compile all of the patched code. | 5921 // Make sure that we can compile all of the patched code. |
| 5922 result = Dart_CompileAll(); | 5922 result = Dart_CompileAll(); |
| 5923 EXPECT_VALID(result); | 5923 EXPECT_VALID(result); |
| 5924 | 5924 |
| 5925 result = Dart_Invoke(test_script, NewString("e1"), 0, NULL); | 5925 result = Dart_Invoke(test_script, NewString("e1"), 0, NULL); |
| 5926 EXPECT_ERROR(result, "method not found: 'unpatched'"); | 5926 EXPECT_ERROR(result, "No top-level method 'unpatched'"); |
| 5927 | 5927 |
| 5928 int64_t value = 0; | 5928 int64_t value = 0; |
| 5929 result = Dart_Invoke(test_script, NewString("m1"), 0, NULL); | 5929 result = Dart_Invoke(test_script, NewString("m1"), 0, NULL); |
| 5930 EXPECT_VALID(result); | 5930 EXPECT_VALID(result); |
| 5931 EXPECT(Dart_IsInteger(result)); | 5931 EXPECT(Dart_IsInteger(result)); |
| 5932 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); | 5932 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); |
| 5933 EXPECT_EQ(4, value); | 5933 EXPECT_EQ(4, value); |
| 5934 | 5934 |
| 5935 value = 0; | 5935 value = 0; |
| 5936 result = Dart_Invoke(test_script, NewString("m2"), 0, NULL); | 5936 result = Dart_Invoke(test_script, NewString("m2"), 0, NULL); |
| (...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7610 NewString("main"), | 7610 NewString("main"), |
| 7611 0, | 7611 0, |
| 7612 NULL); | 7612 NULL); |
| 7613 int64_t value = 0; | 7613 int64_t value = 0; |
| 7614 result = Dart_IntegerToInt64(result, &value); | 7614 result = Dart_IntegerToInt64(result, &value); |
| 7615 EXPECT_VALID(result); | 7615 EXPECT_VALID(result); |
| 7616 EXPECT_EQ(260, value); | 7616 EXPECT_EQ(260, value); |
| 7617 } | 7617 } |
| 7618 | 7618 |
| 7619 } // namespace dart | 7619 } // namespace dart |
| OLD | NEW |