@abaplint/transpiler
Version:
47 lines • 1.51 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HandleSMIM = void 0;
const chunk_1 = require("../chunk");
class HandleSMIM {
runObject(obj, _reg) {
const filename = obj.getXMLFile()?.getFilename().replace(".xml", ".mjs").toLowerCase();
if (filename === undefined) {
return [];
}
obj.parse();
const dataFile = obj.getDataFile();
const chunk = new chunk_1.Chunk().appendString(`abap.SMIM["${obj.getName().toUpperCase()}"] = {
"objectType": "SMIM",
"filename": ${JSON.stringify(dataFile?.getFilename())},
"url": ${JSON.stringify(obj.getURL())},
"class": ${JSON.stringify(obj.getClass())},
};`);
const output = {
object: {
name: obj.getName(),
type: obj.getType(),
},
filename: filename,
chunk: chunk,
requires: [],
exports: [],
};
const ret = [output];
if (dataFile) {
const data = {
object: {
name: obj.getName(),
type: obj.getType(),
},
filename: dataFile?.getFilename(),
chunk: new chunk_1.Chunk().appendString(dataFile?.getRaw()),
requires: [],
exports: [],
};
ret.push(data);
}
return ret;
}
}
exports.HandleSMIM = HandleSMIM;
//# sourceMappingURL=handle_smim.js.map