@@ -8,7 +8,7 @@ import 'dart:io';
8
8
9
9
import 'package:analyzer/dart/analysis/analysis_context_collection.dart' ;
10
10
import 'package:analyzer/dart/analysis/results.dart' ;
11
- import 'package:analyzer/dart/element/element .dart' ;
11
+ import 'package:analyzer/dart/element/element2 .dart' ;
12
12
import 'package:analyzer/dart/element/type.dart' ;
13
13
import 'package:args/args.dart' ;
14
14
import 'package:io/ansi.dart' as ansi;
@@ -201,20 +201,20 @@ Future<void> _generateJsTypeSupertypes() async {
201
201
includedPaths: [p.join (_webPackagePath, 'lib' , 'src' , 'dom.dart' )]);
202
202
final dartJsInterop = (await contextCollection.contexts.single.currentSession
203
203
.getLibraryByUri ('dart:js_interop' ) as LibraryElementResult )
204
- .element ;
205
- final definedNames = dartJsInterop.exportNamespace.definedNames ;
204
+ .element2 ;
205
+ final definedNames = dartJsInterop.exportNamespace.definedNames2 ;
206
206
// `SplayTreeMap` to avoid moving types around in `dart:js_interop` affecting
207
207
// the code generation.
208
208
final jsTypeSupertypes = SplayTreeMap <String , String ?>();
209
209
for (final name in definedNames.keys) {
210
210
final element = definedNames[name];
211
- if (element is ExtensionTypeElement ) {
211
+ if (element is ExtensionTypeElement2 ) {
212
212
// JS types are any extension type that starts with 'JS' in
213
213
// `dart:js_interop`.
214
- bool isJSType (InterfaceElement element) =>
215
- element is ExtensionTypeElement &&
216
- element.library == dartJsInterop &&
217
- element.name .startsWith ('JS' );
214
+ bool isJSType (InterfaceElement2 element) =>
215
+ element is ExtensionTypeElement2 &&
216
+ element.library2 == dartJsInterop &&
217
+ element.name3 ! .startsWith ('JS' );
218
218
if (! isJSType (element)) continue ;
219
219
220
220
String ? parentJsType;
@@ -226,8 +226,8 @@ Future<void> _generateJsTypeSupertypes() async {
226
226
// We should have at most one non-trivial supertype.
227
227
assert (immediateSupertypes.length <= 1 );
228
228
for (final supertype in immediateSupertypes) {
229
- if (isJSType (supertype.element )) {
230
- parentJsType = "'${supertype .element . name }'" ;
229
+ if (isJSType (supertype.element3 )) {
230
+ parentJsType = "'${supertype .element3 . name3 ! }'" ;
231
231
}
232
232
}
233
233
// Ensure that the hierarchy forms a tree.
0 commit comments