Message Area
Casually read the BBS message area using an easy to use interface. Messages are categorized exactly like they are on the BBS. You may post new messages or reply to existing messages!

You are not logged in. Login here for full access privileges.

Previous Message | Next Message | Back to Synchronet Multinode BBS Softwar...  <--  <--- Return to Home Page
   Networked Database  Synchronet Multinode BBS Softwar...   [626 / 900] RSS
 From   To   Subject   Date/Time 
Message   Digital Man    Nightfox   smbdefs.js redeclaration of SMB_SUCCESS   May 3, 2019
 10:56 PM *  

  Re: smbdefs.js redeclaration of SMB_SUCCESS
  By: Nightfox to Digital Man on Fri May 03 2019 07:12 pm

 > Hi DM,
 >
 > I just updated my Synchronet binaries to the latest, and updated my JS
 > scripts to the latest from CVS, and now when I try to read or list messages
 > with my message reader (written in JS), I see the following error:
 >
 > !JavaScript  D:\BBS\sbbs\exec\load\smbdefs.js line 5: TypeError:
 > redeclaration of const SMB_SUCCESS

That tells you that you're load()ing smbdefs.js when it's already been loaded
by something else. So, you've been unnecessarily re-evaluating/executing that
script all this time.

 > I've looked at smbdefs.js and it looks like it's only declared in there
 > once, so I'm a little confused on why it's reporting that error.
 >
 > I tried editing my copy of smbdefs.js and replaced the 'const' with 'var'
 > where SMB_SUCCESS is declared, and that fixed the above error, but then it
 > reported the same redeclaration error with the next one, SMB_DUPE_MSG.  I've
 > replaced all 'const' with 'var' in smbdefs.js and am not getting any of
 > those redeclaration errors now.  I'm not sure if that's the right fix
 > though.

The right fix is to use require() instead of load() for .js files that define
constants (generally, load/*defs.js). require() is smart and will only load()
the specified script if/when necessary. You use it like this:

        require("smbdefs.js", "RFC822HEADER";);

Where the second argument is something that is defined in the load-file that
you need in your script (a constant, variable or function). Then if that
something is already defined, the load-file won't be executed since it's not
necessary ('something' is already defined).

                                            digital man

This Is Spinal Tap quote #21:
So when you're playing you feel like a preserved moose on stage?
Norco, CA WX: 59.1°F, 81.0% humidity, 0 mph SSE wind, 0.00 inches rain/24hrs
--- SBBSecho 3.07-Linux
 * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  Show ANSI Codes | Hide BBCodes | Show Color Codes | Hide Encoding | Hide HTML Tags | Show Routing
Previous Message | Next Message | Back to Synchronet Multinode BBS Softwar...  <--  <--- Return to Home Page

VADV-PHP
Execution Time: 0.0958 seconds

If you experience any problems with this website or need help, contact the webmaster.
VADV-PHP Copyright © 2002-2024 Steve Winn, Aspect Technologies. All Rights Reserved.
Virtual Advanced Copyright © 1995-1997 Roland De Graaf.
v2.0.140505

Warning: Unknown: open(c:\Sessions\sess_hj42pv6edultliist2jfpgd755, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (c:\Sessions) in Unknown on line 0 PHP Warning: session_start(): open(c:\Sessions\sess_hj42pv6edultliist2jfpgd755, O_RDWR) failed: No such file or directory (2) in D:\wc5\http\public\VADV\include\common.inc.php on line 45 PHP Warning: Unknown: open(c:\Sessions\sess_hj42pv6edultliist2jfpgd755, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (c:\Sessions) in Unknown on line 0