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