• src/sbbs3/js_internal.c

    From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Fri Jul 21 12:42:28 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/c2c3cdfc4a890fc622e36cf7ãModified Files:ã src/sbbs3/js_internal.cãLog Message:ãFix js.exec() error message when specified script can't be found

    If the search up the scope tree for js.exec_dir fails, the script 'path' would be left blank leading to a weird error message.
    e.g. !JavaScript default.js line 249: Error: Script file () does not existã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Nightfox@VERT/DIGDIST to Rob Swindell (on Windows) on Fri Jul 21 14:55:45 2023
    Re: src/sbbs3/js_internal.cã By: Rob Swindell (on Windows) to Git commit to main/sbbs/master on Fri Jul 21 2023 12:42 pmãã RS> Fix js.exec() error message when specified script can't be foundãã RS> If the search up the scope tree for js.exec_dir fails, the script 'path'ã RS> would be left blank leading to a weird error message.ã RS> e.g. !JavaScript default.js line 249: Error: Script file () does not existããI just did an update and rebuilt my Synchronet binaries (and updated my default.js as well). That seems to fix the issue we were seeing with DDMsgReader and default.js. But now I'm seeing the same error in a different situation.ããIn my command shell (custom JS), I have this command to run my file area chooser:ããbbs.exec("?../xtrn/DigDist/AreaChoosers/DDFileAreaChooser.js");ããThat works. However, I also have a JS script in my sbbs/mods directory that I use as a test sandbox to try out new things, which I usually run from my main menu. I tried using the same line above in my test script to run my DDFileAreaChooser.js, but when I run that, I get the error:ãã!JavaScript DigitalDistortionTest.js line 8: Error: Script file () does not existããIt seems this might be a recent issue, as I've done similar things in my sandbox test script, and I don't remember seeing this before.ããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã
  • From Digital Man@VERT to Nightfox on Fri Jul 21 16:38:18 2023
    Re: src/sbbs3/js_internal.cã By: Nightfox to Rob Swindell (on Windows) on Fri Jul 21 2023 02:55 pmãã > Re: src/sbbs3/js_internal.cã > By: Rob Swindell (on Windows) to Git commit to main/sbbs/master on Fri Julã > 21 2023 12:42 pmã >ã > RS> Fix js.exec() error message when specified script can't be foundã >ã > RS> If the search up the scope tree for js.exec_dir fails, the scriptã > RS> 'path' would be left blank leading to a weird error message.ã > RS> e.g. !JavaScript default.js line 249: Error: Script file () does notã > RS> existã >ã > I just did an update and rebuilt my Synchronet binaries (and updated myã > default.js as well). That seems to fix the issue we were seeing withã > DDMsgReader and default.js. But now I'm seeing the same error in aã > different situation.ã >ã > In my command shell (custom JS), I have this command to run my file areaã > chooser:ã >ã > bbs.exec("?../xtrn/DigDist/AreaChoosers/DDFileAreaChooser.js");ã >ã > That works. However, I also have a JS script in my sbbs/mods directory thatã > I use as a test sandbox to try out new things, which I usually run from myã > main menu. I tried using the same line above in my test script to run myã > DDFileAreaChooser.js, but when I run that, I get the error:ã >ã > !JavaScript DigitalDistortionTest.js line 8: Error: Script file () does notã > existããThat error message looks to be from js.exec(), not bbs.exec(). The error message itself (the empty parens) was fixed in git today. It doesn't appear you have that fix.ãã > It seems this might be a recent issue, as I've done similar things in myã > sandbox test script, and I don't remember seeing this before.ããNo recent changes to either js.exec() or bbs.exec() that I'm aware of (other than the error message fix I just mentioned).ã-- ã digital man (rob)ããSling Blade quote #10:ãMorris: I stand on the hill, not for thrill, but for the breath of a fresh killãNorco, CA WX: 89.0øF, 30.0% humidity, 11 mph SSE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Nightfox@VERT/DIGDIST to Digital Man on Fri Jul 21 17:25:47 2023
    Re: src/sbbs3/js_internal.cã By: Digital Man to Nightfox on Fri Jul 21 2023 04:38 pmãã >> In my command shell (custom JS), I have this command to run my fileã >> area chooser:ãã >> bbs.exec("?../xtrn/DigDist/AreaChoosers/DDFileAreaChooser.js");ãã >> That works. However, I also have a JS script in my sbbs/modsã >> directory that I use as a test sandbox to try out new things, which Iã >> usually run from my main menu. I tried using the same line above inã >> my test script to run my DDFileAreaChooser.js, but when I run that, Iã >> get the error: ãã >> !JavaScript DigitalDistortionTest.js line 8: Error: Script file ()ã >> does not ã >> existãã DM> That error message looks to be from js.exec(), not bbs.exec(). The errorã DM> message itself (the empty parens) was fixed in git today. It doesn'tã DM> appear you have that fix.ããIt was something silly on my part.. I had a line above it using js.exec(), and I thought I had removed that but it was still in there.ããAlso, I had to check out a fresh copy of the repo in order to rebuild successfully. In the copy of the repo I had, it was getting a build error ('no rule to make target' for something, but I don't remember what it was now). But it's building now, and all is good.ããNightfoxãã---ã þ Synchronet þ Digital Distortion: digitaldistortionbbs.comã
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Fri Sep 1 12:32:50 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/3e1aa12ec62d240e54d6fe0dãModified Files:ã src/sbbs3/js_internal.cãLog Message:ãDon't use scope argument value to js.exec() if it's null

    Fixes issue #611ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Mon Feb 26 23:07:48 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/b1e8d3070d100a5a0ec090aa
    Modified Files:
    src/sbbs3/js_internal.c
    Log Message:
    Update docs for js.auto_terminate to clarify: disconnection will trigger too

    User disconnection will trigger auto-terminate (eventually) as well. But only in the terminal server.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sat Mar 28 18:11:58 2020
    src/sbbs3 js_internal.c 1.95 1.96
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv12239

    Modified Files:
    js_internal.c
    Log Message:
    Fix version number in js.exec() documentation: This method was added in v3.17c not v3.16.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sat Mar 28 18:49:16 2020
    src/sbbs3 js_internal.c 1.96 1.97
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv18457

    Modified Files:
    js_internal.c
    Log Message:
    Fix double-free (of startup_dir) in js.exec() method.
    Improve "script missing" error reporting in js.exec().



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sat Mar 28 22:49:17 2020
    src/sbbs3 js_internal.c 1.97 1.98
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv26628

    Modified Files:
    js_internal.c
    Log Message:
    js.exec() enhancement: if any of the arguments to be passed to the executed script are arrays, pass each element of the array as a separate argument to the child script. This allows one script to generate a variable-length list of arguments to be passed to another.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Tracker1@VERT/TRN to rswindell on Sun Mar 29 01:47:21 2020
    Just curious... what would it take to get Synchronet up to the current spidermonkey engine?

    Related to your recent arguments change for `js.exec()`, having a spread operator would help for when writing such scripts.

    js.exec(...params)

    --
    Michael J. Ryan
    tracker1 +o Roughneck BBS

    ---
    þ Synchronet þ Roughneck BBS - coming back 2/2/20
  • From Digital Man@VERT to Tracker1 on Sun Mar 29 15:12:07 2020
    Re: Re: src/sbbs3/js_internal.c
    By: Tracker1 to rswindell on Sun Mar 29 2020 01:47 am

    Just curious... what would it take to get Synchronet up to the current spidermonkey engine?

    A lot of work.

    Related to your recent arguments change for `js.exec()`, having a spread operator would help for when writing such scripts.

    js.exec(...params)

    We don't have the spread operator currently, but reading about it brought me to function.apply() which looks like that can be used to solve the js.exec() problem I had. I don't need to array argument trick. Thanks for the tip!

    digital man

    This Is Spinal Tap quote #16:
    David St. Hubbins: I believe virtually everything I read...
    Norco, CA WX: 63.9øF, 54.0% humidity, 3 mph ENE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sun Mar 29 16:40:57 2020
    src/sbbs3 js_internal.c 1.98 1.99
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv29776

    Modified Files:
    js_internal.c
    Log Message:
    Revert the last commit (mostly): don't treat array arguments to js.exec() specially, just pass them on to the script as-is. Included a JSDOC note about the use of js.exec.apply() to pass a variable number of arguments (ala execv).

    Thanks Tracker1 for the pointer to 'spread' which led me to function.apply() and the JS-standard method of achieving the result I needed with this enhancement.

    I still think that a script that calls exit() is unlikely to expect non-string arguments in the first place, but if we don't need special case behavior, it's better not to add it and keep the behavior consistent with load() and require(). That was the decision of the executive board anyway. :-|



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to sbbs/master on Fri Sep 25 17:58:22 2020
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/41429b5f199747ddbb2ddb8b
    Modified Files:
    src/sbbs3/js_internal.c
    Log Message:
    Fix 'js' opbject property descriptions in jsobjs.html.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Stephen Hurd@VERT to Git commit to sbbs/master on Tue Nov 17 23:44:34 2020
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/be9d78c653db953092c336e6
    Modified Files:
    src/sbbs3/js_internal.c
    Log Message:
    Eliminate crash in js.on_exit()

    Have js.on_exit() throw an exciption with a useful(?) error when the
    scope already has private data, and that data is not an on_exit list.

    This fixes #182.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Stephen Hurd@VERT to Git commit to sbbs/master on Wed Nov 18 10:56:08 2020
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/34801e27613644ad3ddd6ca4
    Modified Files:
    src/sbbs3/js_internal.c
    Log Message:
    Fix previous commit.

    Copy/paste without the update required a single character to have
    seven different values... which is unlikely to actually happen.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Stephen Hurd@VERT to Git commit to sbbs/master on Wed Nov 18 11:56:52 2020
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/876766e10ef7b9f94c22ad18
    Modified Files:
    src/sbbs3/js_internal.c
    Log Message:
    May as well check the signature in the OnExit handler too.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Thu Aug 8 12:38:17 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/c8a83171c6837d7dabfe698c
    Modified Files:
    src/sbbs3/js_internal.c
    Log Message:
    Fix CID 508259: Control flow issue (DEADCODE)

    ... introduced in commit 54523145

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net