Avoid unnecessary work during lookahead (#9982)

* Do not call pushComment when doing lookahead

* Do no updateContext when doing lookahead

* Do not clone contexts anymore
This commit is contained in:
Daniel Tschinder
2019-05-15 17:02:12 -07:00
committed by GitHub
parent 47eb1ddfe0
commit 4da7a01aa9
2 changed files with 13 additions and 7 deletions

View File

@@ -170,7 +170,7 @@ export default class State {
// $FlowIgnore
let val = this[key];
if ((!skipArrays || key === "context") && Array.isArray(val)) {
if (!skipArrays && Array.isArray(val)) {
val = val.slice();
}