[Pas2js] Pas2js 0.9.20

Mattias Gaertner nc-gaertnma at netcologne.de
Sat May 12 11:14:38 CEST 2018


On Sat, 12 May 2018 15:28:40 +0700
Ryan Joseph <ryan at thealchemistguild.com> wrote:

>[...]
> if i = JSValue then
> 
> but I got a syntax error. I thought JSValue would compare to any compiler type but maybe not. The reason I ask is because we could then do “array of JSValue” in TJSTypedArray.

JS has two equals: == and ===
Using the wrong one is a common cause of JS bugs.

It is not clear which one to use here.
Because Pascal is a strongly typed language I would expect ===, which
is used almost everywhere by pas2js, so it would be consistent from
that pov.
But when you translate JS code to Pascal you might prefer ==.


Mattias


More information about the Pas2js mailing list