Fix the strangest JavaScriptCore bug that I've encountered in ages.

Closes #168. Read comment for more details.
This commit is contained in:
Jürg Lehni 2013-02-08 16:32:47 -08:00
parent 02ca95eb46
commit b6d2d83af5
2 changed files with 9 additions and 1 deletions

View file

@ -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 /^!/

View file

@ -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();
}
});