• src/sbbs3/js_bbs.cpp js_c

    From sbbs@VERT to CVS commit on Monday, January 07, 2019 23:38:00
    src/sbbs3 js_bbs.cpp 1.174 1.175 js_console.cpp 1.121 1.122 main.cpp 1.740 1.741 sbbs.h 1.498 1.499
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/sbbs/src/sbbs3

    Modified Files:
    js_bbs.cpp js_console.cpp main.cpp sbbs.h
    Log Message:
    Fix various JSDOCS_BUILD with gcc warnings.
    warning: ISO C++ forbids converting a string constant to 'char*'
    and comparision between signed/unsigned int.
    This does *not* address the reported build issue:
    In function `_start':
    (.text+0x20): undefined reference to `main'




    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Saturday, May 04, 2019 01:04:00
    src/sbbs3 js_bbs.cpp 1.183 1.184 js_com.c 1.30 1.31 js_console.cpp 1.126 1.127 js_file.c 1.178 1.179 js_global.c 1.378 1.379 js_msgbase.c 1.245 1.246 js_queue.c 1.54 1.55 js_socket.c 1.226 1.227 js_system.c 1.170 1.171 js_user.c 1.108 1.109 main.cpp 1.748 1.749 sbbs.h 1.515 1.516
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv11077

    Modified Files:
    js_bbs.cpp js_com.c js_console.cpp js_file.c js_global.c
    js_msgbase.c js_queue.c js_socket.c js_system.c js_user.c
    main.cpp sbbs.h
    Log Message:
    Define and use a wrapper for JS_GetInstancePrivate(): js_GetClassPrivate()
    Use this in place of JS_GetPrivate() in native class methods that need the class instance's private data pointer and will do bad things if that pointer points to something other than what is expected. mcmlxxix (matt) discovered that using Object.apply(), you can invoke class methods where the 'this' instance is a different class. This would result in
    "Internal Error: No Private Data." or a crash.
    So now, gracefully detect this condition and report a meaningful error: "'<class-name>' instance: No Private Data or Class Mismatch"

    Also, important to note: if the method uses JS_THIS_OBJECT to get the JSObject* to pass to JS_Get*Private, then it must do this *before* it calls JS_SET_RVAL.

    From jsapi.h:
    * NB: there is an anti-dependency between JS_CALLEE and JS_SET_RVAL: native
    * methods that may inspect their callee must defer setting their return value
    * until after any such possible inspection. Otherwise the return value will be
    * inspected instead of the callee function object.

    The js_crypt*.c files still need this treatment.


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