diff --git a/ets2panda/ir/base/classProperty.cpp b/ets2panda/ir/base/classProperty.cpp index 7a07160d7b9125d8f7f12ac3ae74529346f9d1e1..a2217e79f9d9b55cfc1cc7632c308dfcfbf36d12 100644 --- a/ets2panda/ir/base/classProperty.cpp +++ b/ets2panda/ir/base/classProperty.cpp @@ -110,6 +110,10 @@ void ClassProperty::Dump(ir::SrcDumper *dumper) const key_->Dump(dumper); } + if (IsOptionalDeclaration()) { + dumper->Add("?"); + } + if (typeAnnotation_ != nullptr) { dumper->Add(": "); typeAnnotation_->Dump(dumper); @@ -121,6 +125,7 @@ void ClassProperty::Dump(ir::SrcDumper *dumper) const } dumper->Add(";"); + dumper->Endl(); } void ClassProperty::Compile(compiler::PandaGen *pg) const diff --git a/ets2panda/ir/ets/etsParameterExpression.cpp b/ets2panda/ir/ets/etsParameterExpression.cpp index 4b15f70473ec16f9418ca5f77d5d922e25412676..df9262725b6fcfd50baaa98f671cbbb20eedd1d6 100644 --- a/ets2panda/ir/ets/etsParameterExpression.cpp +++ b/ets2panda/ir/ets/etsParameterExpression.cpp @@ -168,11 +168,8 @@ void ETSParameterExpression::Dump(ir::SrcDumper *const dumper) const } } if (initializer_ != nullptr) { - ASSERT(initializer_->IsNumberLiteral()); - if (initializer_->AsNumberLiteral()->Str().Length() > 0) { - dumper->Add(" = "); - initializer_->Dump(dumper); - } + dumper->Add(" = "); + initializer_->Dump(dumper); } } }