@@ -21,7 +21,7 @@ class Program {
2121
2222 // If this field is not `null` then its value must be emitted in the embedded
2323 // global `TYPE_TO_INTERCEPTOR_MAP`. The map references constants and classes.
24- final js.Expression typeToInterceptorMap;
24+ final js.Expression ? typeToInterceptorMap;
2525
2626 // TODO(floitsch): we should store the metadata directly instead of storing
2727 // the collector. However, the old emitter still updates the data.
@@ -173,7 +173,8 @@ class StaticField {
173173 final FieldEntity element;
174174
175175 final js.Name name;
176- final js.Name getterName;
176+ // Null for static non-final fields.
177+ final js.Name ? getterName;
177178 // TODO(floitsch): the holder for static fields is the isolate object. We
178179 // could remove this field and use the isolate object directly.
179180 final js.Expression code;
@@ -252,7 +253,7 @@ class Class {
252253
253254 // If the class implements a function type, and the type is encoded in the
254255 // metatada table, then this field contains the index into that field.
255- final js.Expression functionTypeIndex;
256+ final js.Expression ? functionTypeIndex;
256257
257258 /// Whether the class must be evaluated eagerly.
258259 bool isEager = false ;
@@ -305,11 +306,11 @@ class MixinApplication extends Class {
305306 List <StubMethod > checkedSetters,
306307 List <StubMethod > gettersSetters,
307308 List <StubMethod > isChecks,
308- js.Expression functionTypeIndex,
309- {required bool hasRtiField,
310- required bool onlyForRti,
311- required bool onlyForConstructor,
312- required bool isDirectlyInstantiated})
309+ js.Expression ? functionTypeIndex,
310+ {required super . hasRtiField,
311+ required super . onlyForRti,
312+ required super . onlyForConstructor,
313+ required super . isDirectlyInstantiated})
313314 : super (
314315 element,
315316 typeData,
@@ -322,10 +323,6 @@ class MixinApplication extends Class {
322323 gettersSetters,
323324 isChecks,
324325 functionTypeIndex,
325- hasRtiField: hasRtiField,
326- onlyForRti: onlyForRti,
327- onlyForConstructor: onlyForConstructor,
328- isDirectlyInstantiated: isDirectlyInstantiated,
329326 isNative: false ,
330327 isClosureBaseClass: false ,
331328 isMixinApplicationWithMembers: false );
@@ -363,9 +360,9 @@ class Field {
363360
364361 final bool needsCheckedSetter;
365362
366- final ConstantValue initializerInAllocator;
363+ final ConstantValue ? initializerInAllocator;
367364
368- final ConstantValue constantValue;
365+ final ConstantValue ? constantValue;
369366
370367 final bool isElided;
371368
@@ -407,7 +404,7 @@ abstract class Method {
407404 /// The name of the method. If the method is a [ParameterStubMethod] for a
408405 /// static function, then the name can be `null` . In that case, only the
409406 /// [ParameterStubMethod.callName] should be used.
410- final js.Name name;
407+ final js.Name ? name;
411408 final js.Expression code;
412409
413410 Method (this .element, this .name, this .code);
@@ -488,7 +485,7 @@ class InstanceMethod extends DartMethod {
488485 super .name,
489486 super .code,
490487 super .parameterStubs,
491- js. Name super .callName, {
488+ super .callName, {
492489 required super .needsTearOff,
493490 super .tearOffName,
494491 this .aliasName,
@@ -508,7 +505,7 @@ class InstanceMethod extends DartMethod {
508505
509506 @override
510507 String toString () {
511- return 'InstanceMethod(name=${name .key },element=${element }'
508+ return 'InstanceMethod(name=${name ! .key },element=${element }'
512509 ',code=${js .nodeToString (code )})' ;
513510 }
514511}
@@ -517,12 +514,12 @@ class InstanceMethod extends DartMethod {
517514/// to a method in the original Dart program. Examples are getter and setter
518515/// stubs and stubs to dispatch calls to methods with optional parameters.
519516class StubMethod extends Method {
520- StubMethod (js.Name name, js.Expression code, {MemberEntity ? element})
517+ StubMethod (js.Name ? name, js.Expression code, {MemberEntity ? element})
521518 : super (element, name, code);
522519
523520 @override
524521 String toString () {
525- return 'StubMethod(name=${name .key },element=${element }'
522+ return 'StubMethod(name=${name ! .key },element=${element }'
526523 ',code=${js .nodeToString (code )})' ;
527524 }
528525}
@@ -544,13 +541,12 @@ class ParameterStubMethod extends StubMethod {
544541 /// If a stub's member can not be torn off, the [callName] is `null` .
545542 js.Name ? callName;
546543
547- ParameterStubMethod (js.Name name, this .callName, js.Expression code,
548- {required MemberEntity element})
549- : super (name, code, element: element);
544+ ParameterStubMethod (super .name, this .callName, super .code,
545+ {required super .element});
550546
551547 @override
552548 String toString () {
553- return 'ParameterStubMethod(name=${name .key }, callName=${callName ?.key }'
549+ return 'ParameterStubMethod(name=${name ! .key }, callName=${callName ?.key }'
554550 ', element=${element }'
555551 ', code=${js .nodeToString (code )})' ;
556552 }
@@ -560,7 +556,7 @@ abstract class StaticMethod implements Method {}
560556
561557class StaticDartMethod extends DartMethod implements StaticMethod {
562558 StaticDartMethod (super .element, super .name, super .code, super .parameterStubs,
563- js. Name super .callName,
559+ super .callName,
564560 {required super .needsTearOff,
565561 super .tearOffName,
566562 required super .canBeApplied,
@@ -574,7 +570,7 @@ class StaticDartMethod extends DartMethod implements StaticMethod {
574570
575571 @override
576572 String toString () {
577- return 'StaticDartMethod(name=${name .key },element=${element }'
573+ return 'StaticDartMethod(name=${name ! .key },element=${element }'
578574 ',code=${js .nodeToString (code )})' ;
579575 }
580576}
@@ -586,7 +582,7 @@ class StaticStubMethod extends StubMethod implements StaticMethod {
586582
587583 @override
588584 String toString () {
589- return 'StaticStubMethod(name=${name .key },element=${element }}'
585+ return 'StaticStubMethod(name=${name ! .key },element=${element }}'
590586 ',code=${js .nodeToString (code )})' ;
591587 }
592588}
0 commit comments