From 1cb19b4e093c8e90b00a6b99f62769bcb93c3f08 Mon Sep 17 00:00:00 2001 From: NightRa Date: Tue, 13 Sep 2016 14:58:21 +0300 Subject: [PATCH] Fix performance bug: Dynamic argumets - Bad value context for argument value --- lib/jison.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/jison.js b/lib/jison.js index d078056ee..d59ae7a10 100755 --- a/lib/jison.js +++ b/lib/jison.js @@ -1368,6 +1368,9 @@ function parseError (str, hash) { parser.parseError = lrGeneratorMixin.parseError = parseError; parser.parse = function parse (input) { + var args = [].slice.call(arguments, 1); + +var parseInner = function parseInner (input, args) { var self = this, stack = [0], tstack = [], // token stack @@ -1381,8 +1384,6 @@ parser.parse = function parse (input) { TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - //this.reductionCount = this.shiftCount = 0; var lexer = Object.create(this.lexer); @@ -1604,6 +1605,10 @@ _handle_error: } return true; +} + + return parseInner.bind(this)(input, args); + }; parser.init = function parser_init (dict) {