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 "platform/globals.h" | 5 #include "platform/globals.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 2548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2559 | 2559 |
2560 test_only = false; // Please, insert alias. | 2560 test_only = false; // Please, insert alias. |
2561 var_c = local_scope->LookupVariable(c, test_only); | 2561 var_c = local_scope->LookupVariable(c, test_only); |
2562 EXPECT(var_c->is_captured()); | 2562 EXPECT(var_c->is_captured()); |
2563 | 2563 |
2564 EXPECT_EQ(3, local_scope->num_variables()); // a, b, and c alias. | 2564 EXPECT_EQ(3, local_scope->num_variables()); // a, b, and c alias. |
2565 EXPECT_EQ(2, local_scope->NumCapturedVariables()); // a, c alias. | 2565 EXPECT_EQ(2, local_scope->NumCapturedVariables()); // a, c alias. |
2566 | 2566 |
2567 const int first_parameter_index = 0; | 2567 const int first_parameter_index = 0; |
2568 const int num_parameters = 0; | 2568 const int num_parameters = 0; |
2569 const int type_args_slot = 0; | |
2569 const int first_frame_index = -1; | 2570 const int first_frame_index = -1; |
2570 bool found_captured_vars = false; | 2571 bool found_captured_vars = false; |
2571 int next_frame_index = parent_scope->AllocateVariables( | 2572 int next_frame_index = parent_scope->AllocateVariables( |
2572 first_parameter_index, num_parameters, first_frame_index, NULL, | 2573 first_parameter_index, num_parameters, type_args_slot, first_frame_index, |
Vyacheslav Egorov (Google)
2017/06/20 15:21:41
Does it make sense to make a test *with* type argu
regis
2017/06/21 04:39:04
I updated the test with a type args variable and f
| |
2573 &found_captured_vars); | 2574 NULL, &found_captured_vars); |
2574 EXPECT_EQ(first_frame_index, next_frame_index); // a and c not in frame. | 2575 EXPECT_EQ(first_frame_index, next_frame_index); // a and c not in frame. |
2575 const intptr_t parent_scope_context_level = 1; | 2576 const intptr_t parent_scope_context_level = 1; |
2576 EXPECT_EQ(parent_scope_context_level, parent_scope->context_level()); | 2577 EXPECT_EQ(parent_scope_context_level, parent_scope->context_level()); |
2577 EXPECT(found_captured_vars); | 2578 EXPECT(found_captured_vars); |
2578 | 2579 |
2579 const intptr_t local_scope_context_level = 5; | 2580 const intptr_t local_scope_context_level = 5; |
2580 const ContextScope& context_scope = ContextScope::Handle( | 2581 const ContextScope& context_scope = ContextScope::Handle( |
2581 local_scope->PreserveOuterScope(local_scope_context_level)); | 2582 local_scope->PreserveOuterScope(local_scope_context_level)); |
2582 LocalScope* outer_scope = LocalScope::RestoreOuterScope(context_scope); | 2583 LocalScope* outer_scope = LocalScope::RestoreOuterScope(context_scope); |
2583 EXPECT_EQ(2, outer_scope->num_variables()); | 2584 EXPECT_EQ(2, outer_scope->num_variables()); |
(...skipping 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4722 // utf32->utf16 conversion. | 4723 // utf32->utf16 conversion. |
4723 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, | 4724 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, |
4724 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; | 4725 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; |
4725 | 4726 |
4726 const String& str = | 4727 const String& str = |
4727 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); | 4728 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); |
4728 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); | 4729 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); |
4729 } | 4730 } |
4730 | 4731 |
4731 } // namespace dart | 4732 } // namespace dart |
OLD | NEW |