Virtual Private Server (VPS) Hosting provided by Central Point Networking cpnllc.com
For some reason, the "Nodelist" and "Recent Callers" features are not working.
Sysop: | Ray Quinn |
---|---|
Location: | Visalia, CA |
Users: | 56 |
Nodes: | 10 (0 / 10) |
Uptime: | 147:41:57 |
Calls: | 9 |
Files: | 12,168 |
Messages: | 150,867 |
Check out the US 99 menu above for links to information about US Highway 99, after which the US 99 BBS is named.
Be sure to click on the Amateur Radio menu item above for packet BBSes, packet software, packet organizations, as well as packet how-to's. Also included is links to local and some not-so-local Amateur Radio Clubs.
I have an xjs/ssjs script that, when called once works as expected, but when
called a second time I get:
TypeError: redeclaration of const
If I wait a few minutes and run the script again it works as expected then craps out. Is this a web browser issue? I tried setting the const(s) to undefined and then delete(const) but that did not resolve the redeclaration
issue.
The Synchronet webserver reuses the same JS context across multiple requests from the same client. It can take a few minutes for the client's session to expire and a new context to be created. So basically you may end up reusing the same global scope across multiple executions of a script.
So using 'const' at the *top level* of an XJS/SSJS script is inadvisable. Use 'var' instead.
It's okay to use 'const' inside of functions.
It's probably also okay to wrap your entire script in an IIFE so that you get a fresh scope for each request. However, this context reuse was done for performance reasons, so you'd be sacrificing any performance gain by doing that.
(function () {
// This is an IIFE
// It's an Immediately Invoked Function Expression
})();