| Index: runtime/vm/parser.cc
|
| diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
|
| index 6404df4bee3b3fa0947912b8d93a6fe28930b167..80c6021f622e178a22ea9446e9fca67e761272ab 100644
|
| --- a/runtime/vm/parser.cc
|
| +++ b/runtime/vm/parser.cc
|
| @@ -12012,6 +12012,11 @@ typedef UnorderedHashMap<ConstMapKeyEqualsTraits> ConstantsMap;
|
|
|
| void Parser::CacheConstantValue(TokenPosition token_pos,
|
| const Instance& value) {
|
| + if (current_function().kind() == RawFunction::kImplicitStaticFinalGetter) {
|
| + // Don't cache constants in initializer expressions. They get
|
| + // evaluated only once.
|
| + return;
|
| + }
|
| ConstantPosKey key(String::Handle(Z, script_.url()), token_pos);
|
| if (isolate()->object_store()->compile_time_constants() == Array::null()) {
|
| const intptr_t kInitialConstMapSize = 16;
|
|
|