Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module.exports = async function (BAS_VARS, BAS_API_INTERNAL, BAS_CONSOLE_LOG) {
  2.     var BAS_API = async (API_STRING) => {
  3.         let res = await BAS_API_INTERNAL(API_STRING);
  4.         if (res[1]) throw "-BAS-SILENT-STOP-";
  5.         Object.assign(BAS_VARS, res[0]);
  6.         BAS_VARS["-BAS-NEED-STOP-"] = false;
  7.         if (BAS_VARS["-BAS-API-ERROR-"]) {
  8.             var ex = BAS_VARS["-BAS-API-ERROR-"];
  9.             delete BAS_VARS["-BAS-API-ERROR-"];
  10.             throw ex;
  11.         }
  12.     }
  13.     var BAS_FUNCTION = async (FUNCTION_NAME, FUNCTION_PARAMS) => {
  14.         await BAS_API("_prepare_function_and_call(" + JSON.stringify(FUNCTION_NAME) + "," + JSON.stringify(JSON.stringify(FUNCTION_PARAMS)) + ")!");
  15.         if (BAS_VARS["_BAS_FUNCTION_RESULT_"]) {
  16.             var res = BAS_VARS["_BAS_FUNCTION_RESULT_"];
  17.             delete BAS_VARS["_BAS_FUNCTION_RESULT_"];
  18.             return res;
  19.         }
  20.         return null;
  21.     }
  22.     var BAS_PERHAPS_STOP = () => {
  23.         if (BAS_VARS["-BAS-NEED-STOP-"]) throw "-BAS-SILENT-STOP-"
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement