Skip to content
Snippets Groups Projects
  1. Jan 17, 2021
  2. Jan 16, 2021
    • Rob Swindell's avatar
      Fix js.exec() returned nul" unless exit() was called explicitly · d33fa178
      Rob Swindell authored
      Don't use the "exit_code" property value as the return value of js.exec() unless it's a number. As reported by mlong (thanks).
      
      Also, "exit_code" was being set to null (instead of void/undefined) in js_PrepareToExecute(). I think this was just an oversight or typo by Deuce from his commit of 5 years ago (f3256d81). Since we're comparing exit_code with JSVAL_VOID in other places to determine if it was actually set, this appears to be a long standing bug.
      d33fa178
  3. Nov 23, 2020
    • Deucе's avatar
      Add generic on_exit support. · f67ca829
      Deucе authored
      Store all on_exit() strings in the global scope, execute them
      one scope at a time with scopes ordered in reverse order of
      first call to js.on_exit().  Within a scope, they are ordered
      last string first.
      f67ca829
  4. Nov 18, 2020
  5. Sep 26, 2020
  6. Aug 16, 2020
  7. Mar 29, 2020
  8. Aug 29, 2019
  9. Aug 28, 2019
  10. Aug 27, 2019
  11. Aug 26, 2019
  12. Aug 25, 2019
    • rswindell's avatar
      Fix typo in previous commit. Thanks, NotBert. · d114d05b
      rswindell authored
      d114d05b
    • deuce's avatar
      Add js.exec(). · d53cddaf
      deuce authored
      This allows executing a new script in a specified scope, much like load().
      There are important differences however...
      1) js.exec() *must* specify a scope.
      2) js.exec()d scripts can call exit() and their handlers are ran then,
         rather than when the parent script exists as in js.load().
      3) The js object is installed in the scope with the real JS object as the
         prototype.  This generally shouldn't be an issue, but if you're doing
         strange things, stranger things may happen.
      4) As part of #3, the exec_path/exec_dir/exec_file/startup_dir/scope
         properties of the JS object represent the new script, not the calling
         one.
      5) js.exec() only searches in the passed startup dir (if specified) and the
         current js.exec_dir path.  It does not search the load paths or the mods
         directory at all.
      
      This API is also subject to change.
      d53cddaf
  13. Dec 28, 2018
  14. Feb 20, 2018
  15. Sep 26, 2015
  16. Apr 25, 2015
    • deuce's avatar
      Add jsdocs for js.scope. · 18e8e576
      deuce authored
      18e8e576
    • deuce's avatar
      Fix exit() behaviour by introducing the new js.scope value which is the · f3256d81
      deuce authored
      scripts global scope (as opposed to js.global which is the instance global
      scope), and having exit() define exit_code in js.scope instead of js.global.
      
      This also sets exit_code in js.scope to null when preparing to execute a new
      script.  If a new script starts in the same scope as an old one, the old
      exit_code value will be destroyed.
      
      This should only impact scripts where js.global != js.scope (bbs.exec()ed,
      and mailsrvr)
      f3256d81
  17. Oct 08, 2013
  18. Oct 03, 2013
  19. Sep 13, 2013
  20. Mar 16, 2013
  21. Feb 08, 2013
  22. Mar 15, 2012
  23. Nov 12, 2011
  24. Nov 02, 2011
  25. Oct 29, 2011
  26. Oct 28, 2011
  27. Oct 26, 2011
  28. Oct 19, 2011
Loading