I found (in TMS Web Core 1.6) that an asm...end block in the sourcecode is not a single pascal statement, so one have to be cautious when using it in conditional statements.
For example the code
if USEPDF then
asm
const { jsPDF } = window.jspdf;
const doc = new jsPDF();
doc.setFont("courier", "normal");
doc.setFontSize(12);
end;
compiles to (when USEPDF equals False)
if (false) const { jsPDF } = window.jspdf;
const doc = new jsPDF();
doc.setFont("courier", "normal");
doc.setFontSize(12);
I didn't find any information regarding this behaviour in the (TMS Web Core and pas2js) documentation, so I am not sure if this is a bug or a feature.
Regards,
Meik Stoll