diff --git a/build/minify.sh b/build/minify.sh index 049718fe..f3252831 100755 --- a/build/minify.sh +++ b/build/minify.sh @@ -10,4 +10,6 @@ # # All rights reserved. -uglifyjs ../dist/paper.js -o ../dist/paper-min.js -c unused=false -m -r "_$_,$_" -b ascii_only=true,beautify=false --comments /^!/ +# We need to keep dead_code around for now, since the very odd JavaScriptCore +# scope bug fix (nop().nop()) requires it. +uglifyjs ../dist/paper.js -o ../dist/paper-min.js -c unused=false,dead_code=false -m -r "_$_,$_" -b ascii_only=true,beautify=false --comments /^!/ diff --git a/src/path/Segment.js b/src/path/Segment.js index e3e0eac1..42f2f480 100644 --- a/src/path/Segment.js +++ b/src/path/Segment.js @@ -421,5 +421,11 @@ var Segment = this.Segment = Base.extend(/** @lends Segment# */{ } } return coords; + // NOTE: There is a very strange bug in JavaScriptCore that causes + // segments to receive wrong values after the transformation of a very + // large amount of segments. For some strange reason, this unreachable + // stamement causes JavaScriptCore to optimize code differently and not + // cause the error. There is no nop() function... + nop().nop(); } });