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

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

Issue 1797063002: Resolve obvious deprecation warnings on bleeding edge (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Add test Created 4 years, 9 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/code_generator.dart ('k') | lib/src/codegen/js_field_storage.dart » ('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 ea3c8e14548952286d5ed32d9f0b76516b467afb..0ee0c9feacdfbc309b5677e085319cfe2282eacb 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -6,9 +6,15 @@ import 'dart:collection' show HashSet, HashMap, SplayTreeSet;
import 'package:analyzer/analyzer.dart' hide ConstantEvaluator;
import 'package:analyzer/dart/ast/token.dart';
-import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator;
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/dart/element/visitor.dart';
+import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/dart/ast/ast.dart' hide ConstantEvaluator;
import 'package:analyzer/src/generated/constant.dart';
-import 'package:analyzer/src/generated/element.dart';
+//TODO(leafp): Remove deprecated dependency
+//ignore: DEPRECATED_MEMBER_USE
+import 'package:analyzer/src/generated/element.dart'
+ show DynamicElementImpl, DynamicTypeImpl, LocalVariableElementImpl;
import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
import 'package:analyzer/src/dart/ast/token.dart'
@@ -497,7 +503,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor
// Create constructor and initialize index
var constructor = new JS.Method(
name, js.call('function(index) { this.index = index; }') as JS.Fun);
- var fields = new List<ConstFieldElementImpl>.from(
+ var fields = new List<FieldElement>.from(
element.fields.where((f) => f.type == type));
// Create toString() method
@@ -1732,9 +1738,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor
_loader.declareBeforeUse(element);
// type literal
- if (element is ClassElement ||
- element is DynamicElementImpl ||
- element is FunctionTypeAliasElement) {
+ if (element is TypeDefiningElement) {
return _emitTypeName(
fillDynamicTypeArgs((element as dynamic).type, types));
}
« no previous file with comments | « lib/src/codegen/code_generator.dart ('k') | lib/src/codegen/js_field_storage.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698