Skip to content

Commit

Permalink
Fix performance bug: Dynamic argumets - Bad value context for argumen…
Browse files Browse the repository at this point in the history
…t value
  • Loading branch information
NightRa committed Sep 13, 2016
1 parent 7653842 commit 1cb19b4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/jison.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -1604,6 +1605,10 @@ _handle_error:
}

return true;
}

return parseInner.bind(this)(input, args);

};

parser.init = function parser_init (dict) {
Expand Down

0 comments on commit 1cb19b4

Please sign in to comment.