From bf4fffab1cc83056a6e73a6dfa664e006e2312b0 Mon Sep 17 00:00:00 2001 From: Vladimir Grichina Date: Tue, 8 Jan 2019 23:46:11 -0800 Subject: [PATCH] Fix nesting array parsing --- assembly/decoder.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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();