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

Unified Diff: pkg/compiler/lib/src/js_backend/backend_impact.dart

Issue 2608143002: Refactor BackendHelpers to make 'find' methods private. (Closed)
Patch Set: Updated cf. 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_backend/backend_impact.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend_impact.dart b/pkg/compiler/lib/src/js_backend/backend_impact.dart
index 2a3244c03407f2f1246a19ae3fb322809b5e1737..92c6fc95021d990ddd53e94cd14171eaea37c783 100644
--- a/pkg/compiler/lib/src/js_backend/backend_impact.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_impact.dart
@@ -269,19 +269,12 @@ class BackendImpacts {
BackendImpact _constantMapLiteral;
BackendImpact get constantMapLiteral {
- if (_constantMapLiteral == null) {
- ClassElement find(String name) {
- return helpers.find(helpers.jsHelperLibrary, name);
- }
-
- _constantMapLiteral = new BackendImpact(instantiatedClasses: [
- find(JavaScriptMapConstant.DART_CLASS),
- find(JavaScriptMapConstant.DART_PROTO_CLASS),
- find(JavaScriptMapConstant.DART_STRING_CLASS),
- find(JavaScriptMapConstant.DART_GENERAL_CLASS)
- ]);
- }
- return _constantMapLiteral;
+ return _constantMapLiteral ??= new BackendImpact(instantiatedClasses: [
+ helpers.constantMapClass,
+ helpers.constantProtoMapClass,
+ helpers.constantStringMapClass,
+ helpers.generalConstantMapClass,
+ ]);
}
BackendImpact _symbolConstructor;
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend_helpers.dart ('k') | pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698