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

Side by Side Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 1955103003: Fix order of output of references with invokeMethodRef. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_const_expr.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library analyzer.test.src.summary.summary_common; 5 library analyzer.test.src.summary.summary_common;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/dart/ast/ast.dart'; 8 import 'package:analyzer/dart/ast/ast.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/src/dart/scanner/reader.dart'; 10 import 'package:analyzer/src/dart/scanner/reader.dart';
(...skipping 6886 matching lines...) Expand 10 before | Expand all | Expand 10 after
6897 (EntityRef r) => checkTypeRef(r, null, null, 'm', 6897 (EntityRef r) => checkTypeRef(r, null, null, 'm',
6898 expectedKind: ReferenceKind.method, 6898 expectedKind: ReferenceKind.method,
6899 prefixExpectations: [ 6899 prefixExpectations: [
6900 new _PrefixExpectation(ReferenceKind.classOrEnum, 'C', 6900 new _PrefixExpectation(ReferenceKind.classOrEnum, 'C',
6901 absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'), 6901 absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'),
6902 new _PrefixExpectation(ReferenceKind.prefix, 'p') 6902 new _PrefixExpectation(ReferenceKind.prefix, 'p')
6903 ]) 6903 ])
6904 ]); 6904 ]);
6905 } 6905 }
6906 6906
6907 test_expr_invokeMethodRef_with_reference_arg() {
6908 if (skipNonConstInitializers) {
6909 return;
6910 }
6911 UnlinkedVariable variable = serializeVariableText('''
6912 f(x) => null;
6913 final u = null;
6914 final v = f(u);
6915 ''');
6916 _assertUnlinkedConst(variable.constExpr, isValidConst: false, operators: [
6917 UnlinkedConstOperation.pushReference,
6918 UnlinkedConstOperation.invokeMethodRef
6919 ], ints: [
6920 0,
6921 1
6922 ], referenceValidators: [
6923 (EntityRef r) => checkTypeRef(r, null, null, 'u',
6924 expectedKind: ReferenceKind.topLevelPropertyAccessor),
6925 (EntityRef r) => checkTypeRef(r, null, null, 'f',
6926 expectedKind: ReferenceKind.topLevelFunction)
6927 ]);
6928 }
6929
6907 test_expr_throwException() { 6930 test_expr_throwException() {
6908 if (skipNonConstInitializers) { 6931 if (skipNonConstInitializers) {
6909 return; 6932 return;
6910 } 6933 }
6911 UnlinkedVariable variable = serializeVariableText(''' 6934 UnlinkedVariable variable = serializeVariableText('''
6912 final v = throw 1 + 2; 6935 final v = throw 1 + 2;
6913 '''); 6936 ''');
6914 _assertUnlinkedConst(variable.constExpr, isValidConst: false, operators: [ 6937 _assertUnlinkedConst(variable.constExpr, isValidConst: false, operators: [
6915 UnlinkedConstOperation.pushInt, 6938 UnlinkedConstOperation.pushInt,
6916 UnlinkedConstOperation.pushInt, 6939 UnlinkedConstOperation.pushInt,
(...skipping 2943 matching lines...) Expand 10 before | Expand all | Expand 10 after
9860 class _PrefixExpectation { 9883 class _PrefixExpectation {
9861 final ReferenceKind kind; 9884 final ReferenceKind kind;
9862 final String name; 9885 final String name;
9863 final String absoluteUri; 9886 final String absoluteUri;
9864 final String relativeUri; 9887 final String relativeUri;
9865 final int numTypeParameters; 9888 final int numTypeParameters;
9866 9889
9867 _PrefixExpectation(this.kind, this.name, 9890 _PrefixExpectation(this.kind, this.name,
9868 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); 9891 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0});
9869 } 9892 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_const_expr.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698