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

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

Issue 1641643004: Roll analyzer to 0.27.2-alpha.1 (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rerun tests and format Created 4 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
« no previous file with comments | « lib/runtime/dart/js.js ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 7f9a7438fc2f15f2c54a79d48e887b942252ffb4..4f8fb37729976491d28e231d9839270d6150d3f5 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -505,7 +505,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
var genericName = '$name\$';
JS.Statement genericDef = null;
- if (_boundTypeParametersOf(type).isNotEmpty) {
+ if (_typeFormalsOf(type).isNotEmpty) {
genericDef = _emitGenericClassDef(type, body);
}
// The base class and all mixins must be declared before this class.
@@ -537,7 +537,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
JS.Statement _emitGenericClassDef(ParameterizedType type, JS.Statement body) {
var name = type.name;
var genericName = '$name\$';
- var typeParams = _boundTypeParametersOf(type).map((p) => p.name);
+ var typeParams = _typeFormalsOf(type).map((p) => p.name);
if (isPublic(name)) _exports.add(genericName);
return js.statement('const # = dart.generic(function(#) { #; return #; });',
[genericName, typeParams, body, name]);
@@ -1556,7 +1556,6 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
// indirects back to a (possibly synthetic) field.
var element = accessor;
if (accessor is PropertyAccessorElement) element = accessor.variable;
- if (accessor is FunctionMember) element = accessor.baseElement;
_loader.declareBeforeUse(element);
@@ -3262,10 +3261,8 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
}
/// Return the bound type parameters for a ParameterizedType
- List<TypeParameterElement> _boundTypeParametersOf(ParameterizedType type) {
- return (type is FunctionType)
- ? type.boundTypeParameters
- : type.typeParameters;
+ List<TypeParameterElement> _typeFormalsOf(ParameterizedType type) {
+ return type is FunctionType ? type.typeFormals : type.typeParameters;
}
/// Like [_emitMemberName], but for declaration sites.
« no previous file with comments | « lib/runtime/dart/js.js ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698