Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
05fbccb8
Commit
05fbccb8
authored
3 years ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
Have js_execfile() save/restore callbacks
This should allow callbacks to not interfere between (say) shells and doors.
parent
8512b601
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/exec.cpp
+18
-0
18 additions, 0 deletions
src/sbbs3/exec.cpp
with
18 additions
and
0 deletions
src/sbbs3/exec.cpp
+
18
−
0
View file @
05fbccb8
...
...
@@ -560,6 +560,11 @@ long sbbs_t::js_execfile(const char *cmd, const char* startup_dir, JSObject* sco
jsval
old_js_argc
=
JSVAL_VOID
;
jsval
rval
;
int32
result
=
0
;
struct
js_event_list
*
events
;
struct
js_runq_entry
*
rq_head
;
struct
js_runq_entry
*
rq_tail
;
struct
js_listener_entry
*
listeners
;
if
(
js_cx
==
NULL
)
js_cx
=
this
->
js_cx
;
...
...
@@ -682,6 +687,14 @@ long sbbs_t::js_execfile(const char *cmd, const char* startup_dir, JSObject* sco
#endif
}
js_PrepareToExecute
(
js_cx
,
js_glob
,
path
,
startup_dir
,
js_scope
);
events
=
js_callback
.
events
;
js_callback
.
events
=
NULL
;
rq_head
=
js_callback
.
rq_head
;
js_callback
.
rq_head
=
NULL
;
rq_tail
=
js_callback
.
rq_tail
;
js_callback
.
rq_tail
=
NULL
;
listeners
=
js_callback
.
listeners
;
js_callback
.
listeners
=
NULL
;
JS_ExecuteScript
(
js_cx
,
js_scope
,
js_script
,
&
rval
);
js_handle_events
(
js_cx
,
&
js_callback
,
&
terminated
);
sys_status
&=~
SS_ABORT
;
...
...
@@ -715,6 +728,11 @@ long sbbs_t::js_execfile(const char *cmd, const char* startup_dir, JSObject* sco
JS_GC
(
js_cx
);
js_callback
.
events
=
events
;
js_callback
.
rq_head
=
rq_head
;
js_callback
.
rq_tail
=
rq_tail
;
js_callback
.
listeners
=
listeners
;
JS_ENDREQUEST
(
js_cx
);
return
(
result
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment