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

Unified Diff: lib/src/codegen/js_typeref_codegen.dart

Issue 1724463003: refactor: avoid parts (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « lib/src/codegen/js_interop.dart ('k') | test/codegen/expect/collection/src/queue_list.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_typeref_codegen.dart
diff --git a/lib/src/codegen/js_typeref_codegen.dart b/lib/src/codegen/js_typeref_codegen.dart
index f6f5d61e0c5fc416291703623f2f75c616ac0304..78f7d9a1c5037b98217befd41684f47e7c82ce87 100644
--- a/lib/src/codegen/js_typeref_codegen.dart
+++ b/lib/src/codegen/js_typeref_codegen.dart
@@ -2,7 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of js_codegen;
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
+import 'package:analyzer/src/generated/utilities_dart.dart';
+
+import '../js/js_ast.dart' as JS;
+import '../options.dart';
+import 'js_interop.dart';
/// Mixin with logic to generate [TypeRef]s out of [DartType]s.
abstract class JsTypeRefCodegen {
@@ -11,10 +17,9 @@ abstract class JsTypeRefCodegen {
// Mixin dependencies:
CodegenOptions get options;
TypeProvider get types;
- JS.Identifier get _namedArgTemp;
+ JS.Identifier get namedArgumentTemp;
LibraryElement get currentLibrary;
- JS.Identifier _libraryName(LibraryElement e);
- String _getJSExportName(Element e);
+ JS.Identifier emitLibraryName(LibraryElement e);
/// Finds the qualified path to the type.
JS.TypeRef _emitTopLevelTypeRef(DartType type) {
@@ -23,8 +28,8 @@ abstract class JsTypeRefCodegen {
return new JS.TypeRef.named(type.name);
} else {
return new JS.TypeRef.qualified([
- _libraryName(e.library),
- new JS.Identifier(_getJSExportName(e) ?? type.name)
+ emitLibraryName(e.library),
+ new JS.Identifier(getJSExportName(e, types) ?? type.name)
]);
}
}
@@ -57,7 +62,7 @@ abstract class JsTypeRefCodegen {
}
var namedParamType = emitNamedParamsArgType(type.parameters);
if (namedParamType != null) {
- args[_namedArgTemp] = namedParamType.toOptional();
+ args[namedArgumentTemp] = namedParamType.toOptional();
}
rawType = new JS.TypeRef.function(emitTypeRef(type.returnType), args);
« no previous file with comments | « lib/src/codegen/js_interop.dart ('k') | test/codegen/expect/collection/src/queue_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698