Prevent V8 "assignment to parameter in arguments object" deoptimizations.

Some getter-like functions still need fixing, but this might require a fix in Straps.js first.
This commit is contained in:
Jürg Lehni 2013-12-17 23:28:55 +01:00
parent 3dbad9c477
commit 81651a7379
14 changed files with 139 additions and 133 deletions
src/project

View file

@ -290,11 +290,11 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* information about what exactly was hit or {@code null} if nothing was
* hit
*/
hitTest: function(point, options) {
hitTest: function(/* point, options */) {
// We don't need to do this here, but it speeds up things since we won't
// repeatetly convert in Item#hitTest() then.
point = Point.read(arguments);
options = HitResult.getOptions(Base.read(arguments));
var point = Point.read(arguments),
options = HitResult.getOptions(Base.read(arguments));
// Loop backwards, so layers that get drawn last are tested first
for (var i = this.layers.length - 1; i >= 0; i--) {
var res = this.layers[i].hitTest(point, options);