File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ FlowGraph* StreamingFlowGraphBuilder::BuildGraphOfFieldInitializer() {
54
54
body += Constant (
55
55
Instance::ZoneHandle (Z, constant_reader_.ReadConstantExpression ()));
56
56
} else {
57
+ body += SetupCapturedParameters (parsed_function ()->function ());
57
58
body += BuildExpression (); // read initializer.
58
59
}
59
60
body += Return (TokenPosition::kNoSource );
Original file line number Diff line number Diff line change @@ -2779,7 +2779,7 @@ class Function : public Object {
2779
2779
2780
2780
bool HasThisParameter () const {
2781
2781
return IsDynamicFunction (/* allow_abstract=*/ true ) ||
2782
- IsGenerativeConstructor ();
2782
+ IsGenerativeConstructor () || ( IsFieldInitializer () && ! is_static ()) ;
2783
2783
}
2784
2784
2785
2785
bool IsDynamicFunction (bool allow_abstract = false ) const {
@@ -3245,7 +3245,7 @@ class Function : public Object {
3245
3245
return kind () == RawFunction::kImplicitSetter ;
3246
3246
}
3247
3247
3248
- // Returns true if this function represents an the initializer for a static or
3248
+ // Returns true if this function represents an initializer for a static or
3249
3249
// instance field. The function returns the initial value and the caller is
3250
3250
// responsible for setting the field.
3251
3251
bool IsFieldInitializer () const {
You can’t perform that action at this time.
0 commit comments