Skip to content
Snippets Groups Projects
  1. Jan 18, 2025
    • Rob Swindell's avatar
      Make global read(0) and readln(0) return undefined · d4d05239
      Rob Swindell authored
      This is really an error condition, so like the jsdocs say:
      return undefined upon error
      
      This how read(0) worked in sbbs, but not jsexec before that last commit,
      so now just make readln and read work like that in both sbbs and jsexec.
      d4d05239
    • Rob Swindell's avatar
      Global JS function parameter validation and updated return types · 4914fa1d
      Rob Swindell authored
      Many global functions now throw an exception when null or undefined is passed
      as a required parameter where null or undefined makes no sense.
      e.g. "Argument #1 is an unexpected 'null' or 'undefined' value"
      Example exception: is-a/has-a type functions will still return false when
      passed null or undefined.
      
      Changed global function return types:
      - write() now always returns undefined
      - printf() always returns a string, never undefined or garbage string
      - prompt() returns null (not undefined) upon no input (as documented)
      
      sbbs works more like jsexec:
      - read(0) now returns an empty string instead of undefined
      - readln(0) no longer waits for enter
      
      jsexec works more like sbbs:
      - add missing write_raw() global function, alias for write()
      
      Include expected number of argment in "Insufficient Arguments" exception
      message.
      
      Update JSDOCS for some global methods:
      - file_chmod returns boolean, not number
      - flags_str requires a minimum of one argument
      
      New tests to validate expected exceptions and return types based on usage.
      4914fa1d
    • echicken's avatar
      New build with workaround for terminal cleanup on exit. · 926b0c5e
      echicken authored
      Updated TS4S so we can build with -t while issue #777 is ongoing.
      
      Ran `npm audit fix` to address a security issue in some dependency
      of the build system. Perhaps this will silence the alert GitHub
      sent to DM; I'm not sure what that was.
      926b0c5e
    • Rob Swindell's avatar
      Make these tests runnable from sbbs · 033329f1
      Rob Swindell authored
      Don't use chdir(), just use js.exec_dir instead (e.g. for location of test.crt)
      
      Use console instead of stdout when stdout isn't defined.
      
      Log the file and line number of an an exception in a nested test when it
      happens.
      033329f1
  2. Jan 17, 2025
  3. Jan 16, 2025
Loading