[Pas2js] Disable optimization in specific units/blocks

silvioprog silvioprog at gmail.com
Fri Jan 11 21:09:30 CET 2019


On Fri, Jan 11, 2019 at 4:09 PM Mattias Gaertner via Pas2js <
pas2js at lists.freepascal.org> wrote:
[...]

> Now I wonder if we are talking about the same thing.
>

Let me explain it using ...

Are you complaining that the procedure FooBar itself is never
> called and therefore removed?
>

... this small example in attachment. Just compile and run it. Notice the
following error via browser console:

"Uncaught TypeError: pas.program.foo is not a function".

The only way to solve it is by uncommenting the line 20 to make an explicit
call to the foo() function in the Pascal code, but it would be nice a
directive something like showed in the line 5, because ...


> So it has nothing to do with asm-blocks?
>

... such functions are polyfills
<https://developer.mozilla.org/en-US/docs/Glossary/Polyfill>, so they are
called only in some old browsers, but the compiler has been removed them.

-- 
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20190111/30521be1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dilemma.tar.gz
Type: application/gzip
Size: 1315 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20190111/30521be1/attachment.gz>


More information about the Pas2js mailing list