@@ -21,7 +21,7 @@ class Program {
21
21
22
22
// If this field is not `null` then its value must be emitted in the embedded
23
23
// global `TYPE_TO_INTERCEPTOR_MAP`. The map references constants and classes.
24
- final js.Expression typeToInterceptorMap;
24
+ final js.Expression ? typeToInterceptorMap;
25
25
26
26
// TODO(floitsch): we should store the metadata directly instead of storing
27
27
// the collector. However, the old emitter still updates the data.
@@ -173,7 +173,8 @@ class StaticField {
173
173
final FieldEntity element;
174
174
175
175
final js.Name name;
176
- final js.Name getterName;
176
+ // Null for static non-final fields.
177
+ final js.Name ? getterName;
177
178
// TODO(floitsch): the holder for static fields is the isolate object. We
178
179
// could remove this field and use the isolate object directly.
179
180
final js.Expression code;
@@ -252,7 +253,7 @@ class Class {
252
253
253
254
// If the class implements a function type, and the type is encoded in the
254
255
// metatada table, then this field contains the index into that field.
255
- final js.Expression functionTypeIndex;
256
+ final js.Expression ? functionTypeIndex;
256
257
257
258
/// Whether the class must be evaluated eagerly.
258
259
bool isEager = false ;
@@ -305,11 +306,11 @@ class MixinApplication extends Class {
305
306
List <StubMethod > checkedSetters,
306
307
List <StubMethod > gettersSetters,
307
308
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})
313
314
: super (
314
315
element,
315
316
typeData,
@@ -322,10 +323,6 @@ class MixinApplication extends Class {
322
323
gettersSetters,
323
324
isChecks,
324
325
functionTypeIndex,
325
- hasRtiField: hasRtiField,
326
- onlyForRti: onlyForRti,
327
- onlyForConstructor: onlyForConstructor,
328
- isDirectlyInstantiated: isDirectlyInstantiated,
329
326
isNative: false ,
330
327
isClosureBaseClass: false ,
331
328
isMixinApplicationWithMembers: false );
@@ -363,9 +360,9 @@ class Field {
363
360
364
361
final bool needsCheckedSetter;
365
362
366
- final ConstantValue initializerInAllocator;
363
+ final ConstantValue ? initializerInAllocator;
367
364
368
- final ConstantValue constantValue;
365
+ final ConstantValue ? constantValue;
369
366
370
367
final bool isElided;
371
368
@@ -407,7 +404,7 @@ abstract class Method {
407
404
/// The name of the method. If the method is a [ParameterStubMethod] for a
408
405
/// static function, then the name can be `null` . In that case, only the
409
406
/// [ParameterStubMethod.callName] should be used.
410
- final js.Name name;
407
+ final js.Name ? name;
411
408
final js.Expression code;
412
409
413
410
Method (this .element, this .name, this .code);
@@ -488,7 +485,7 @@ class InstanceMethod extends DartMethod {
488
485
super .name,
489
486
super .code,
490
487
super .parameterStubs,
491
- js. Name super .callName, {
488
+ super .callName, {
492
489
required super .needsTearOff,
493
490
super .tearOffName,
494
491
this .aliasName,
@@ -508,7 +505,7 @@ class InstanceMethod extends DartMethod {
508
505
509
506
@override
510
507
String toString () {
511
- return 'InstanceMethod(name=${name .key },element=${element }'
508
+ return 'InstanceMethod(name=${name ! .key },element=${element }'
512
509
',code=${js .nodeToString (code )})' ;
513
510
}
514
511
}
@@ -517,12 +514,12 @@ class InstanceMethod extends DartMethod {
517
514
/// to a method in the original Dart program. Examples are getter and setter
518
515
/// stubs and stubs to dispatch calls to methods with optional parameters.
519
516
class StubMethod extends Method {
520
- StubMethod (js.Name name, js.Expression code, {MemberEntity ? element})
517
+ StubMethod (js.Name ? name, js.Expression code, {MemberEntity ? element})
521
518
: super (element, name, code);
522
519
523
520
@override
524
521
String toString () {
525
- return 'StubMethod(name=${name .key },element=${element }'
522
+ return 'StubMethod(name=${name ! .key },element=${element }'
526
523
',code=${js .nodeToString (code )})' ;
527
524
}
528
525
}
@@ -544,13 +541,12 @@ class ParameterStubMethod extends StubMethod {
544
541
/// If a stub's member can not be torn off, the [callName] is `null` .
545
542
js.Name ? callName;
546
543
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});
550
546
551
547
@override
552
548
String toString () {
553
- return 'ParameterStubMethod(name=${name .key }, callName=${callName ?.key }'
549
+ return 'ParameterStubMethod(name=${name ! .key }, callName=${callName ?.key }'
554
550
', element=${element }'
555
551
', code=${js .nodeToString (code )})' ;
556
552
}
@@ -560,7 +556,7 @@ abstract class StaticMethod implements Method {}
560
556
561
557
class StaticDartMethod extends DartMethod implements StaticMethod {
562
558
StaticDartMethod (super .element, super .name, super .code, super .parameterStubs,
563
- js. Name super .callName,
559
+ super .callName,
564
560
{required super .needsTearOff,
565
561
super .tearOffName,
566
562
required super .canBeApplied,
@@ -574,7 +570,7 @@ class StaticDartMethod extends DartMethod implements StaticMethod {
574
570
575
571
@override
576
572
String toString () {
577
- return 'StaticDartMethod(name=${name .key },element=${element }'
573
+ return 'StaticDartMethod(name=${name ! .key },element=${element }'
578
574
',code=${js .nodeToString (code )})' ;
579
575
}
580
576
}
@@ -586,7 +582,7 @@ class StaticStubMethod extends StubMethod implements StaticMethod {
586
582
587
583
@override
588
584
String toString () {
589
- return 'StaticStubMethod(name=${name .key },element=${element }}'
585
+ return 'StaticStubMethod(name=${name ! .key },element=${element }}'
590
586
',code=${js .nodeToString (code )})' ;
591
587
}
592
588
}
0 commit comments