diff --git a/assembly/decoder.ts b/assembly/decoder.ts index 2edb455..384cdc7 100644 --- a/assembly/decoder.ts +++ b/assembly/decoder.ts @@ -165,8 +165,9 @@ export class JSONDecoder { if (this.peekChar() != "[".charCodeAt(0)) { return false; } - if (this.handler.pushArray(this.state.lastKey)) { - this.state.lastKey = null; + let key = this.state.lastKey; + this.state.lastKey = null; + if (this.handler.pushArray(key)) { this.readChar(); this.skipWhitespace();