Incorrect instanceof line
Boolean operations and offsetting library in Javascript
Brought to you by:
timo23414
Javascript Clipper 6.1.3.2 contains the following (unminified) line:
if (!polygon[0] instanceof Array) results = results[0];
The Google Closure Compiler complains about this, and is right: the unary !
binds stronger than the binary instanceof
, so this is parsed as
if ((!polygon[0]) instanceof Array) results = results[0];
which will always be false. Other lines are similar but explicitely parenthesized to
if (!(polygon[0] instanceof Array)) results = results[0];
That remaining line should be adjusted accordingly as well.
Hi, Martin!
Thanks for opening the first ticket ever!
You are correct. Fortunately this doesn't affect to core Clipper but only to helper function
ClipperLib.JS.Lighten()
. (I have no idea why I didn't mention this, because I used Google Closure Compiler for minifying.)This will be fixed in next release.
This is Closure Compiler version v20140923 if that is of any help to you.
This is fixed in 6.2.1.0.