oops - state must be popped before writing indent

otherwise the closing } on non-empty objects is incorrectly indented
This commit is contained in:
Kae 2024-04-18 08:46:48 +10:00
parent 5d9108c469
commit 5bf3b20542

View File

@ -521,12 +521,13 @@ public:
}
void endObject() {
if (currentState() == ObjectElement) {
bool isNotEmpty = currentState() == ObjectElement;
popState(Object);
if (isNotEmpty) {
if (m_pretty)
write('\n');
indent();
}
popState(Object);
write('}');
}