diff --git a/.gitignore b/.gitignore index 2f6141d..b5afa97 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,52 @@ node_modules npm-debug.log -.DS_Store \ No newline at end of file +.DS_Store +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm + +*.iml + +## Directory-based project format: +.idea/ +# if you remove the above rule, at least ignore the following: + +# User-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# .idea/dictionaries + +# Sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml +# .idea/uiDesigner.xml + +# Gradle: +# .idea/gradle.xml +# .idea/libraries + +# Mongo Explorer plugin: +# .idea/mongoSettings.xml + +## File-based project format: +*.ipr +*.iws + +## Plugin-specific files: + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties + + diff --git a/lib/nexpect.js b/lib/nexpect.js index bba5086..d35bb33 100644 --- a/lib/nexpect.js +++ b/lib/nexpect.js @@ -127,7 +127,11 @@ function chain (context) { // function run had `name`. // function evalContext (data, name) { - var currentFn = context.queue[0]; + + var currentFn; + + if (context.queue.length > 0) + currentFn = context.queue[0]; if (!currentFn || (name === '_expect' && currentFn.name === '_expect')) { // @@ -304,6 +308,10 @@ function chain (context) { callback(null, stdout, signal || code); }); + setTimeout(function() { + evalContext(); + }); + return context.process; } };