Skip to content

Commit

Permalink
fix: prevent deopt
Browse files Browse the repository at this point in the history
  • Loading branch information
BridgeAR committed Jun 4, 2017
1 parent 0e20257 commit 5c76401
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,17 @@ function pushArrayCache (parser, array, pos) {
* @returns {undefined|any[]}
*/
function parseArrayChunks (parser) {
const tmp = parser.arrayCache.pop()
var arr = parser.arrayCache.pop()
var pos = parser.arrayPos.pop()
if (parser.arrayCache.length) {
const res = parseArrayChunks(parser)
if (res === undefined) {
pushArrayCache(parser, tmp, pos)
pushArrayCache(parser, arr, pos)
return
}
tmp[pos++] = res
arr[pos++] = res
}
return parseArrayElements(parser, tmp, pos)
return parseArrayElements(parser, arr, pos)
}

/**
Expand Down

0 comments on commit 5c76401

Please sign in to comment.