Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: listeners[i] is not a function #4

Open
christianbundy opened this issue Jun 18, 2020 · 0 comments · May be fixed by #5
Open

TypeError: listeners[i] is not a function #4

christianbundy opened this issue Jun 18, 2020 · 0 comments · May be fixed by #5

Comments

@christianbundy
Copy link

christianbundy commented Jun 18, 2020

This happens when a listener is removed during another listener's execution. :~)

      Error: TypeError: listeners[i] is not a function
          at Test.assert [as _assert] (/home/christianbundy/src/obv/node_modules/tape/lib/test.js:228:54)
          at Test.bound [as _assert] (/home/christianbundy/src/obv/node_modules/tape/lib/test.js:80:32)
          at Test.fail (/home/christianbundy/src/obv/node_modules/tape/lib/test.js:322:10)
          at Test.bound [as fail] (/home/christianbundy/src/obv/node_modules/tape/lib/test.js:80:32)
          at Test.<anonymous> (/home/christianbundy/src/obv/test/trigger.js:190:9)
          at Test.bound [as _cb] (/home/christianbundy/src/obv/node_modules/tape/lib/test.js:80:32)
          at Test.run (/home/christianbundy/src/obv/node_modules/tape/lib/test.js:96:10)
          at Test.bound [as run] (/home/christianbundy/src/obv/node_modules/tape/lib/test.js:80:32)
          at Immediate.next [as _onImmediate] (/home/christianbundy/src/obv/node_modules/tape/lib/results.js:83:19)
          at processImmediate (internal/timers.js:456:21)
christianbundy added a commit to christianbundy/obv that referenced this issue Jun 18, 2020
Problem: If you remove a listener while the trigger is running, you'll
get a "listeners[i] is not a funcion" error.

Solution: Ensure that `listeners[i]` is a function before trying to run
it.

Fixes: dominictarr#4
@christianbundy christianbundy linked a pull request Jun 18, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant