-
src/sbbs3/js_internal.c
From
rswindell@VERT to
CVS commit on Friday, December 28, 2018 03:38:00
src/sbbs3 js_internal.c 1.87 1.88
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/home/rswindell/sbbs/src/sbbs3
Modified Files:
js_internal.c
Log Message:
Fixed typo in JSDOC description of js.load_path_list property.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
-
From
deuce@VERT to
CVS commit on Sunday, August 25, 2019 08:54:33
src/sbbs3 js_internal.c 1.88 1.89
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv23072
Modified Files:
js_internal.c
Log Message:
Add js.exec().
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.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
-
From
rswindell@VERT to
CVS commit on Sunday, August 25, 2019 20:06:28
src/sbbs3 js_internal.c 1.89 1.90
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/home/rswindell/sbbs/src/sbbs3
Modified Files:
js_internal.c
Log Message:
Fix typo in previous commit. Thanks, NotBert.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
-
From
deuce@VERT to
CVS commit on Monday, August 26, 2019 03:38:02
src/sbbs3 js_internal.c 1.90 1.91
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv11223
Modified Files:
js_internal.c
Log Message:
If an exception is thrown by the exec()d script, return it instead of the exit_code, and don't throw the exception in the caller.
Remove support for js_scope == scope. It sorta defeats the whole purpose
of js.exec().
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
-
From
deuce@VERT to
CVS commit on Tuesday, August 27, 2019 00:10:25
src/sbbs3 js_internal.c 1.91 1.92
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv4528
Modified Files:
js_internal.c
Log Message:
js.exec() fixes.
A child of the parent scopes js object can't do on_exit() stuff properly
due to the missing private context. Create a new JS object in the child instead.
We also need to copy in the js.load_path_list array contents since we don't want the child changing the parent by accident.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
-
From
deuce@VERT to
CVS commit on Tuesday, August 27, 2019 18:54:46
src/sbbs3 js_internal.c 1.92 1.93
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv14332
Modified Files:
js_internal.c
Log Message:
Respect the actual scoping rules, and add a note on properly creating a
child scope.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
-
From
rswindell@VERT to
CVS commit on Wednesday, August 28, 2019 01:36:24
src/sbbs3 js_internal.c 1.93 1.94
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv9938
Modified Files:
js_internal.c
Log Message:
Resolve a couple MSVC warnings about signed/unsigned value comparisons.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
-
From
deuce@VERT to
CVS commit on Thursday, August 29, 2019 16:35:01
src/sbbs3 js_internal.c 1.94 1.95
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv7915
Modified Files:
js_internal.c
Log Message:
Initialize path.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
-
From
Rob Swindell@VERT to
Git commit to sbbs/master on Saturday, September 26, 2020 00:58:22
-
From
Stephen Hurd@VERT to
Git commit to sbbs/master on Wednesday, November 18, 2020 07:44:34
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 Wednesday, November 18, 2020 18:56:08
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 Wednesday, November 18, 2020 19:56:52
-
From
Rob Swindell@VERT to
Git commit to main/sbbs/master on Saturday, January 16, 2021 23:20:34
https://gitlab.synchro.net/main/sbbs/-/commit/da7c67c99b965eb7e77bf699
Modified Files:
src/sbbs3/js_internal.c
Log Message:
Fix js.exec() returned nul" unless exit() was called explicitly
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.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
-
From
Rob Swindell@VERT to
Git commit to main/sbbs/master on Sunday, January 17, 2021 01:37:43
https://gitlab.synchro.net/main/sbbs/-/commit/a4fd167b477a07103a95e6b9
Modified Files:
src/sbbs3/js_internal.c
Log Message:
Deuce wants js.exec() to support non-number return values via exit_code
<@Deuce> Just saying that if someone does the work of exit_code = {thing: function(x) { return secretsauce }); exit(); they should get away with it.
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
-
From
Deuc¿@VERT to
Git commit to main/sbbs/master on Saturday, May 22, 2021 03:43:02