22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5- // @dart = 2.9
6-
75import 'package:kernel/class_hierarchy.dart' ;
86import 'package:kernel/core_types.dart' ;
97import 'package:kernel/kernel.dart' ;
108import 'package:kernel/type_environment.dart' ;
9+
1110import '../compiler/js_typerep.dart' ;
1211import 'kernel_helpers.dart' ;
1312
@@ -32,9 +31,8 @@ class JSTypeRep extends SharedJSTypeRep<DartType> {
3231 @override
3332 JSType typeFor (DartType type) {
3433 while (type is TypeParameterType ) {
35- type = ( type as TypeParameterType ) .parameter.bound;
34+ type = type.parameter.bound;
3635 }
37- if (type == null ) return JSType .jsUnknown;
3836 assert (isKnownDartTypeImplementor (type));
3937
4038 // Note that this should be changed if Dart gets non-nullable types
@@ -65,11 +63,12 @@ class JSTypeRep extends SharedJSTypeRep<DartType> {
6563 return JSType .jsObject;
6664 }
6765
68- /// Given a Dart type return the known implementation type, if any.
69- /// Given `bool` , `String` , or `num` /`int` /`double` ,
70- /// returns the corresponding class in `dart:_interceptors` :
71- /// `JSBool` , `JSString` , and `JSNumber` respectively, otherwise null.
72- Class getImplementationClass (DartType t) {
66+ /// Returns the known implementation type for [t] , if any.
67+ ///
68+ /// Given `bool` , `String` , or `num` /`int` /`double` , returns the corresponding
69+ /// class in `dart:_interceptors` : `JSBool` , `JSString` , and `JSNumber`
70+ /// respectively, otherwise null.
71+ Class ? getImplementationClass (DartType t) {
7372 var rep = typeFor (t);
7473 // Number, String, and Bool are final
7574 if (rep == JSType .jsNumber) return _jsNumber;
0 commit comments