<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello,<div><br></div><div>I've got a problem in a code I'm maintaining that uses some asm-blocks and the final script must be built using the compiler optimization. The problem is: my JS code is completely removed.</div><div><br></div><div>So, is there some option to disable the optimization in specific parts of the project? For example:</div><div><br></div><div><font face="monospace, monospace" size="1">{$PUSH}{$SOMETHING_TO_DISABLE_THE_OPTIMIZATION_HERE OFF}</font></div><div><font face="monospace, monospace" size="1"><br></font></div><div><font face="monospace, monospace" size="1">procedure Foo;</font></div><div><font face="monospace, monospace" size="1">asm</font></div><div><font face="monospace, monospace" size="1">  // ... my very required Vanilla JS polyfill here ...</font></div><div><font face="monospace, monospace" size="1">end;<br></font><div><font face="monospace, monospace" size="1"><br></font></div><div><font face="monospace, monospace" size="1">{$POP}</font></div><div><br></div><div>IMHO, the compiler should not remove the custom JS scripts of the programmer unconditionally, because it maybe raise a lot of undefined errors. I would like to solve them using pure pas2js code (or Vanilla Pas 😅), but we need some polyfills which couldn't be solved using pure Pascal, since some compiler features are missing (yet).</div><div><br></div><div>For a while, it seems the only available option is to disable the entire optimizer. Well, it is very bad, cause it will generate the final application script about 2.9 MB (in the front-end world, scripts of this magnitude are unacceptable, specially for embedded applications.), against about 1.2 MB using the optimizer. (1.2 MB is minified to ~900 kB using some minify tool)</div><div><br></div><div>Any tricks to solve it? Thanks in advance for any help!</div><div><br></div><div>p.s: the project has been compiled using Pas2JS 1.0.3.</div><div><br></div>--<br><div dir="ltr" class="gmail-m_-398333146222842208gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div></div></div></div></div></div></div></div></div>