Merge pull request #414 from Gozala/bug/regexp-keys

bindings should not be over-normalized  if (key is set to null it should stay
This commit is contained in:
Fabian Jakobs 2011-09-26 02:33:31 -07:00
commit fe7ad3bb0c

View file

@ -64,7 +64,8 @@ StateHandler.prototype = {
if (binding.key) {
binding.key = new RegExp('^' + binding.key + '$');
} else if (Array.isArray(binding.regex)) {
binding.key = new RegExp('^' + binding.regex[1] + '$');
if (!('key' in binding))
binding.key = new RegExp('^' + binding.regex[1] + '$');
binding.regex = new RegExp(binding.regex.join('') + '$');
} else if (binding.regex) {
binding.regex = new RegExp(binding.regex + '$');