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

Side by Side Diff: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart

Issue 2849893002: Set 'enclosingElement' for FunctionElementImpl_forLUB. (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 _InstrumentationValueForType(this.type); 112 _InstrumentationValueForType(this.type);
113 113
114 @override 114 @override
115 String toString() { 115 String toString() {
116 StringBuffer buffer = new StringBuffer(); 116 StringBuffer buffer = new StringBuffer();
117 _appendType(buffer, type); 117 _appendType(buffer, type);
118 return buffer.toString(); 118 return buffer.toString();
119 } 119 }
120 120
121 void _appendElementName(StringBuffer buffer, Element element) { 121 void _appendElementName(StringBuffer buffer, Element element) {
122 String name = element.name; 122 String name = element.name ?? '';
123 if (element.library == null) { 123 if (element.library == null) {
124 // TODO(scheglov) This is wrong - every element must be in a library. 124 // TODO(scheglov) This is wrong - every element must be in a library.
125 buffer.write('<unknown>::$name'); 125 buffer.write('<unknown>::$name');
126 return; 126 return;
127 } 127 }
128 String libraryName = element.library.name; 128 String libraryName = element.library.name;
129 if (libraryName == '') { 129 if (libraryName == '') {
130 throw new StateError('The element $name must be in a named library.'); 130 throw new StateError('The element $name must be in a named library.');
131 } 131 }
132 if (libraryName != 'dart.core' && 132 if (libraryName != 'dart.core' &&
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 void _recordType(int offset, DartType type) { 299 void _recordType(int offset, DartType type) {
300 _instrumentation.record( 300 _instrumentation.record(
301 uri, offset, 'type', new _InstrumentationValueForType(type)); 301 uri, offset, 'type', new _InstrumentationValueForType(type));
302 } 302 }
303 303
304 void _recordTypeArguments(int offset, List<DartType> typeArguments) { 304 void _recordTypeArguments(int offset, List<DartType> typeArguments) {
305 _instrumentation.record(uri, offset, 'typeArgs', 305 _instrumentation.record(uri, offset, 'typeArgs',
306 new _InstrumentationValueForTypeArgs(typeArguments)); 306 new _InstrumentationValueForTypeArgs(typeArguments));
307 } 307 }
308 } 308 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698