| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 "include/dart_tools_api.h" | 6 #include "include/dart_tools_api.h" |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/lockers.h" | 10 #include "vm/lockers.h" |
| (...skipping 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2173 " Banana,\n" | 2173 " Banana,\n" |
| 2174 "}\n" | 2174 "}\n" |
| 2175 "var x;\n" | 2175 "var x;\n" |
| 2176 "main() {\n" | 2176 "main() {\n" |
| 2177 " String r = '$x ${x.hashCode is int} ${x.index}';\n" | 2177 " String r = '$x ${x.hashCode is int} ${x.index}';\n" |
| 2178 " return r;\n" | 2178 " return r;\n" |
| 2179 "}\n"; | 2179 "}\n"; |
| 2180 | 2180 |
| 2181 lib = TestCase::ReloadTestScript(kReloadScript); | 2181 lib = TestCase::ReloadTestScript(kReloadScript); |
| 2182 EXPECT_VALID(lib); | 2182 EXPECT_VALID(lib); |
| 2183 EXPECT_STREQ("Fruit.Cantalope true 2", SimpleInvokeStr(lib, "main")); | 2183 EXPECT_STREQ("Deleted enum value from Fruit true -1", |
| 2184 SimpleInvokeStr(lib, "main")); |
| 2184 } | 2185 } |
| 2185 | 2186 |
| 2186 | 2187 |
| 2187 TEST_CASE(IsolateReload_EnumIdentityReload) { | 2188 TEST_CASE(IsolateReload_EnumIdentityReload) { |
| 2188 const char* kScript = | 2189 const char* kScript = |
| 2189 "enum Fruit {\n" | 2190 "enum Fruit {\n" |
| 2190 " Apple,\n" | 2191 " Apple,\n" |
| 2191 " Banana,\n" | 2192 " Banana,\n" |
| 2192 " Cantalope,\n" | 2193 " Cantalope,\n" |
| 2193 "}\n" | 2194 "}\n" |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3410 lib = TestCase::ReloadTestScript(kReloadScript); | 3411 lib = TestCase::ReloadTestScript(kReloadScript); |
| 3411 EXPECT_VALID(lib); | 3412 EXPECT_VALID(lib); |
| 3412 // Verify that we ran field initializers on existing instances in the | 3413 // Verify that we ran field initializers on existing instances in the |
| 3413 // correct scope. | 3414 // correct scope. |
| 3414 EXPECT_STREQ("right", SimpleInvokeStr(lib, "main")); | 3415 EXPECT_STREQ("right", SimpleInvokeStr(lib, "main")); |
| 3415 } | 3416 } |
| 3416 | 3417 |
| 3417 #endif // !PRODUCT | 3418 #endif // !PRODUCT |
| 3418 | 3419 |
| 3419 } // namespace dart | 3420 } // namespace dart |
| OLD | NEW |