UNPKG

@abaplint/transpiler

Version:
41 lines 1.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HandleEnqu = void 0; const chunk_1 = require("../chunk"); // view, much like the tables class HandleEnqu { runObject(obj, _reg) { const filename = obj.getXMLFile()?.getFilename().replace(".xml", ".mjs").toLowerCase(); if (filename === undefined) { return []; } const chunk = new chunk_1.Chunk().appendString(`// enqueue object abap.FunctionModules["ENQUEUE_${obj.getName().toUpperCase()}"] = async (INPUT) => { const lookup = abap.Classes["KERNEL_LOCK"]; if (lookup === undefined) { throw new Error("Lock, kernel class missing"); } await lookup.enqueue(INPUT); }; abap.FunctionModules["DEQUEUE_${obj.getName().toUpperCase()}"] = async (INPUT) => { const lookup = abap.Classes["KERNEL_LOCK"]; if (lookup === undefined) { throw new Error("Lock, kernel class missing"); } await lookup.dequeue(INPUT); };`); const output = { object: { name: obj.getName(), type: obj.getType(), }, filename: filename, chunk: chunk, requires: [], exports: [], }; return [output]; } } exports.HandleEnqu = HandleEnqu; //# sourceMappingURL=handle_enqu.js.map