Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(910)

Unified Diff: tests/compiler/dart2js/semantic_visitor_test_send_data.dart

Issue 1303503002: Refactor updates of locals. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/semantic_visitor_test_send_data.dart
diff --git a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
index 0419caed0e6a373d117acb4cf3ed9c61117acf3f..bc5a96537885c9884bfaad3d7b92a049f9710e3a 100644
--- a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
@@ -19,10 +19,9 @@ const Map<String, List<Test>> SEND_TESTS = const {
element: 'parameter(m#o)',
arguments: '(null,42)',
selector: 'CallStructure(arity=2)')),
- // TODO(johnniwinther): Expect [VISIT_FINAL_PARAMETER_SET] instead.
const Test('m(final o) { o = 42; }',
- const Visit(VisitKind.VISIT_UNRESOLVED_SET,
- name: 'o',
+ const Visit(VisitKind.VISIT_FINAL_PARAMETER_SET,
+ element: 'parameter(m#o)',
rhs:'42')),
],
'Local variables': const [
@@ -39,15 +38,13 @@ const Map<String, List<Test>> SEND_TESTS = const {
element: 'variable(m#o)',
arguments: '(null,42)',
selector: 'CallStructure(arity=2)')),
- // TODO(johnniwinther): Expect [VISIT_FINAL_LOCAL_VARIABLE_SET] instead.
const Test('m() { final o = 0; o = 42; }',
- const Visit(VisitKind.VISIT_UNRESOLVED_SET,
- name: 'o',
+ const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET,
+ element: 'variable(m#o)',
rhs:'42')),
- // TODO(johnniwinther): Expect [VISIT_FINAL_LOCAL_VARIABLE_SET] instead.
const Test('m() { const o = 0; o = 42; }',
- const Visit(VisitKind.VISIT_UNRESOLVED_SET,
- name: 'o',
+ const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET,
+ element: 'variable(m#o)',
rhs:'42')),
],
'Local functions': const [
@@ -65,10 +62,9 @@ const Map<String, List<Test>> SEND_TESTS = const {
element: 'function(m#o)',
arguments: '(null,42)',
selector: 'CallStructure(arity=2)')),
- // TODO(johnniwinther): Expect [VISIT_LOCAL_FUNCTION_SET] instead.
const Test('m() { o(a, b) {}; o = 42; }',
- const Visit(VisitKind.VISIT_UNRESOLVED_SET,
- name: 'o',
+ const Visit(VisitKind.VISIT_LOCAL_FUNCTION_SET,
+ element: 'function(m#o)',
rhs: '42')),
],
'Static fields': const [
@@ -1419,6 +1415,14 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Test(
'''
class C {}
+ m() => C = 42;
+ ''',
+ const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_SET,
+ constant: 'C',
+ rhs: '42')),
+ const Test(
+ '''
+ class C {}
m() => C += 42;
''',
const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_COMPOUND,
@@ -1473,6 +1477,14 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Test(
'''
typedef F();
+ m() => F = 42;
+ ''',
+ const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET,
+ constant: 'F',
+ rhs: '42')),
+ const Test(
+ '''
+ typedef F();
m() => F += 42;
''',
const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_COMPOUND,
@@ -1518,6 +1530,15 @@ const Map<String, List<Test>> SEND_TESTS = const {
const Test.clazz(
'''
class C<T> {
+ m() => T = 42;
+ }
+ ''',
+ const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET,
+ element: 'type_variable(C#T)',
+ rhs: '42')),
+ const Test.clazz(
+ '''
+ class C<T> {
m() => T += 42;
}
''',
« no previous file with comments | « tests/compiler/dart2js/semantic_visitor_test.dart ('k') | tests/compiler/dart2js/semantic_visitor_test_send_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698