Permalink
Browse files

see #1: don't join path when it's not necessary

  • Loading branch information...
1 parent 9e7a003 commit 3fda34d9c180045faebc59656471d64020fc41ef @thejh committed Jan 15, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 index.js
View
4 index.js
@@ -13,17 +13,15 @@ module.exports = function makeParser() {
var listener = null
function maybeStartCapture() {
- if (path.length === 0) return
+ if (path.length === 0 || listener) return
var key1 = path.join('.')
var key2 = path.slice(0, -1).join('.')+'.'
if (has(listeners, key1)) {
- if (listener) throw new Error('multiple active listeners at a time not supported yet')
listener = listeners[key1]
stack = []
}
if (has(listeners, key2)) {
if (DEBUG) console.log('pathlen: '+path.length)
- if (listener) throw new Error('multiple active listeners at a time not supported yet')
listener = listeners[key2]
stack = []
}

0 comments on commit 3fda34d

Please sign in to comment.