Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs");
// cl_abap_dyn_prg.clas.abap
class cl_abap_dyn_prg {
static STATIC_SUPER = undefined;
static INTERNAL_TYPE = 'CLAS';
static INTERNAL_NAME = 'CL_ABAP_DYN_PRG';
static IMPLEMENTED_INTERFACES = [];
static ATTRIBUTES = {};
static METHODS = {"CHECK_TABLE_NAME_STR": {"visibility": "U", "parameters": {"VAL_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " ", "parm_kind": "R", "type_name": "StringType"}, "VAL": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}, "PACKAGES": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}, "INCL_SUB_PACKAGES": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " ", "parm_kind": "I", "type_name": "CharacterType"}}},
"CHECK_WHITELIST_STR": {"visibility": "U", "parameters": {"VAL_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " ", "parm_kind": "R", "type_name": "StringType"}, "VAL": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}, "WHITELIST": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}}},
"QUOTE": {"visibility": "U", "parameters": {"OUT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " ", "parm_kind": "R", "type_name": "StringType"}, "VAL": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}}},
"ESCAPE_QUOTES": {"visibility": "U", "parameters": {"OUT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " ", "parm_kind": "R", "type_name": "StringType"}, "VAL": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}}},
"ESCAPE_XSS_XML_HTML": {"visibility": "U", "parameters": {"OUT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " ", "parm_kind": "R", "type_name": "StringType"}, "VAL": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}}},
"ESCAPE_XSS_URL": {"visibility": "U", "parameters": {"OUT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " ", "parm_kind": "R", "type_name": "StringType"}, "VAL": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}}},
"CHECK_TABLE_OR_VIEW_NAME_STR": {"visibility": "U", "parameters": {"VAL_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " ", "parm_kind": "R", "type_name": "StringType"}, "VAL": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}, "PACKAGES": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}, "INCL_SUB_PACKAGES": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " ", "parm_kind": "I", "type_name": "CharacterType"}}},
"ESCAPE_QUOTES_STR": {"visibility": "U", "parameters": {"OUT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " ", "parm_kind": "R", "type_name": "StringType"}, "VAL": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}}},
"CHECK_WHITELIST_TAB": {"visibility": "U", "parameters": {"VAL_STR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " ", "parm_kind": "R", "type_name": "StringType"}, "VAL": {"type": () => {return new abap.types.Character();}, "is_optional": " ", "parm_kind": "I", "type_name": "CSequenceType"}, "WHITELIST": {"type": () => {return abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_HASHED_TABLE");}, "is_optional": " ", "parm_kind": "I", "type_name": "TableType"}}}};
constructor() {
this.me = new abap.types.ABAPObject();
this.me.set(this);
this.INTERNAL_ID = abap.internalIdCounter++;
this.FRIENDS_ACCESS_INSTANCE = {
};
}
async constructor_(INPUT) {
if (super.constructor_) { await super.constructor_(INPUT); }
return this;
}
async check_whitelist_tab(INPUT) {
return cl_abap_dyn_prg.check_whitelist_tab(INPUT);
}
static async check_whitelist_tab(INPUT) {
let val_str = new abap.types.String({qualifiedName: "STRING"});
let val = INPUT?.val;
let whitelist = INPUT?.whitelist;
if (whitelist?.getQualifiedName === undefined || whitelist.getQualifiedName() !== "STRING_HASHED_TABLE") { whitelist = undefined; }
if (whitelist === undefined) { whitelist = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_HASHED_TABLE").set(INPUT.whitelist); }
abap.statements.assert(abap.compare.eq(abap.IntegerFactory.get(1), abap.CharacterFactory.get(4, 'todo')));
return val_str;
}
async escape_quotes_str(INPUT) {
return cl_abap_dyn_prg.escape_quotes_str(INPUT);
}
static async escape_quotes_str(INPUT) {
let out = new abap.types.String({qualifiedName: "STRING"});
let val = INPUT?.val;
out.set(val);
abap.statements.replace({target: out, all: true, with: abap.CharacterFactory.get(2, '``'), of: abap.CharacterFactory.get(1, '`')});
return out;
}
async check_table_or_view_name_str(INPUT) {
return cl_abap_dyn_prg.check_table_or_view_name_str(INPUT);
}
static async check_table_or_view_name_str(INPUT) {
let val_str = new abap.types.String({qualifiedName: "STRING"});
let val = INPUT?.val;
let packages = INPUT?.packages;
let incl_sub_packages = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
if (INPUT && INPUT.incl_sub_packages) {incl_sub_packages.set(INPUT.incl_sub_packages);}
if (INPUT === undefined || INPUT.incl_sub_packages === undefined) {incl_sub_packages = abap.builtin.abap_false;}
val_str.set(val);
return val_str;
}
async check_table_name_str(INPUT) {
return cl_abap_dyn_prg.check_table_name_str(INPUT);
}
static async check_table_name_str(INPUT) {
let val_str = new abap.types.String({qualifiedName: "STRING"});
let val = INPUT?.val;
let packages = INPUT?.packages;
let incl_sub_packages = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
if (INPUT && INPUT.incl_sub_packages) {incl_sub_packages.set(INPUT.incl_sub_packages);}
val_str.set(val);
return val_str;
}
async check_whitelist_str(INPUT) {
return cl_abap_dyn_prg.check_whitelist_str(INPUT);
}
static async check_whitelist_str(INPUT) {
let val_str = new abap.types.String({qualifiedName: "STRING"});
let val = INPUT?.val;
let whitelist = INPUT?.whitelist;
val_str.set(val);
return val_str;
}
async quote(INPUT) {
return cl_abap_dyn_prg.quote(INPUT);
}
static async quote(INPUT) {
let out = new abap.types.String({qualifiedName: "STRING"});
let val = INPUT?.val;
out.set(abap.operators.concat(new abap.types.String().set(`'`),abap.operators.concat((await this.escape_quotes({val: val})),new abap.types.String().set(`'`))));
return out;
}
async escape_xss_url(INPUT) {
return cl_abap_dyn_prg.escape_xss_url(INPUT);
}
static async escape_xss_url(INPUT) {
let out = new abap.types.String({qualifiedName: "STRING"});
let val = INPUT?.val;
out.set(encodeURIComponent(val.get().trimEnd()).replace(/[!''()]/g, c => "%" + c.charCodeAt(0).toString(16)).toLowerCase());
return out;
}
async escape_quotes(INPUT) {
return cl_abap_dyn_prg.escape_quotes(INPUT);
}
static async escape_quotes(INPUT) {
let out = new abap.types.String({qualifiedName: "STRING"});
let val = INPUT?.val;
out.set(val);
abap.statements.replace({target: out, all: true, with: new abap.types.String().set(`''`), of: new abap.types.String().set(`'`)});
return out;
}
async escape_xss_xml_html(INPUT) {
return cl_abap_dyn_prg.escape_xss_xml_html(INPUT);
}
static async escape_xss_xml_html(INPUT) {
let out = new abap.types.String({qualifiedName: "STRING"});
let val = INPUT?.val;
let lv_index = new abap.types.Integer({qualifiedName: "I"});
let lv_code = new abap.types.Integer({qualifiedName: "I"});
let lv_hex = new abap.types.String({qualifiedName: "STRING"});
out.set(abap.CharacterFactory.get(1, ''));
const indexBackup1 = abap.builtin.sy.get().index.get();
const unique1384 = abap.builtin.strlen({val: val}).get();
for (let unique1385 = 0; unique1385 < unique1384; unique1385++) {
abap.builtin.sy.get().index.set(unique1385 + 1);
lv_index.set(abap.operators.minus(abap.builtin.sy.get().index,abap.IntegerFactory.get(1)));
lv_code.set(val.get().charCodeAt(lv_index.get()));
if (abap.compare.eq(lv_code, abap.IntegerFactory.get(60))) {
out.set(abap.operators.concat(out,abap.CharacterFactory.get(4, '<')));
} else if (abap.compare.eq(lv_code, abap.IntegerFactory.get(62))) {
out.set(abap.operators.concat(out,abap.CharacterFactory.get(4, '>')));
} else if (abap.compare.eq(lv_code, abap.IntegerFactory.get(38))) {
out.set(abap.operators.concat(out,abap.CharacterFactory.get(5, '&')));
} else if ((abap.compare.ge(lv_code, abap.IntegerFactory.get(65)) && abap.compare.le(lv_code, abap.IntegerFactory.get(90))) || (abap.compare.ge(lv_code, abap.IntegerFactory.get(97)) && abap.compare.le(lv_code, abap.IntegerFactory.get(122))) || (abap.compare.ge(lv_code, abap.IntegerFactory.get(48)) && abap.compare.le(lv_code, abap.IntegerFactory.get(57)))) {
out.set(out.get() + String.fromCharCode(lv_code.get()));
} else {
lv_hex.set(lv_code.get().toString(16));
out.set(abap.operators.concat(out,abap.operators.concat(abap.CharacterFactory.get(3, '&#x'),abap.operators.concat(lv_hex,abap.CharacterFactory.get(1, ';')))));
}
}
abap.builtin.sy.get().index.set(indexBackup1);
return out;
}
}
abap.Classes['CL_ABAP_DYN_PRG'] = cl_abap_dyn_prg;
export {cl_abap_dyn_prg}; |