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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend_helpers.dart

Issue 2647043002: Fix hints reported by analyzer. (Closed)
Patch Set: Address review comments. Created 3 years, 11 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) 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 dart2js.js_backend.helpers; 5 library dart2js.js_backend.helpers;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart' show Identifiers, Uris; 8 import '../common/names.dart' show Identifiers, Uris;
9 import '../common/resolution.dart' show Resolution; 9 import '../common/resolution.dart' show Resolution;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 ConstructorElement get symbolValidatedConstructor { 200 ConstructorElement get symbolValidatedConstructor {
201 return _symbolValidatedConstructor ??= _findConstructor( 201 return _symbolValidatedConstructor ??= _findConstructor(
202 symbolImplementationClass, symbolValidatedConstructorSelector.name); 202 symbolImplementationClass, symbolValidatedConstructorSelector.name);
203 } 203 }
204 204
205 // TODO(johnniwinther): Make these private. 205 // TODO(johnniwinther): Make these private.
206 // TODO(johnniwinther): Split into _findHelperFunction and _findHelperClass 206 // TODO(johnniwinther): Split into _findHelperFunction and _findHelperClass
207 // and add a check that the element has the expected kind. 207 // and add a check that the element has the expected kind.
208 Element _findHelper(String name) => _find(jsHelperLibrary, name); 208 Element _findHelper(String name) => _find(jsHelperLibrary, name);
209 FunctionElement _findHelperFunction(String name) =>
210 _find(jsHelperLibrary, name);
211 Element _findAsyncHelper(String name) => _find(asyncLibrary, name); 209 Element _findAsyncHelper(String name) => _find(asyncLibrary, name);
212 Element _findInterceptor(String name) => _find(interceptorsLibrary, name); 210 Element _findInterceptor(String name) => _find(interceptorsLibrary, name);
213 Element _find(LibraryElement library, String name) { 211 Element _find(LibraryElement library, String name) {
214 Element element = library.implementation.findLocal(name); 212 Element element = library.implementation.findLocal(name);
215 assert(invariant(library, element != null, 213 assert(invariant(library, element != null,
216 message: "Element '$name' not found in '${library.canonicalUri}'.")); 214 message: "Element '$name' not found in '${library.canonicalUri}'."));
217 return element; 215 return element;
218 } 216 }
219 217
220 Element findCoreHelper(String name) => 218 Element findCoreHelper(String name) =>
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 } 873 }
876 874
877 MethodElement get toStringForNativeObject { 875 MethodElement get toStringForNativeObject {
878 return _findHelper('toStringForNativeObject'); 876 return _findHelper('toStringForNativeObject');
879 } 877 }
880 878
881 MethodElement get hashCodeForNativeObject { 879 MethodElement get hashCodeForNativeObject {
882 return _findHelper('hashCodeForNativeObject'); 880 return _findHelper('hashCodeForNativeObject');
883 } 881 }
884 } 882 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/backend_impact.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698