Skip to content

Commit

Permalink
add "var" of self in strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
newxps committed Apr 5, 2016
1 parent ed36e69 commit 1a8ecb7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
charset = utf-8
root = true

[*]
indent_style = tab
indent_size = 2
6 changes: 3 additions & 3 deletions move.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

var timer = 't' + Math.random();

self = this;
var self = this;

//用于保存定时器ID的对象, requestAnimation递归调用必须传入对象
this[timer] = {};
Expand All @@ -113,10 +113,10 @@
y = moveType(x);
fn(a + (b - a) * y);
}
}, self[timer]);
var }, self[timer]);

return function(){
_stopMove(self[timer]);
var _stopMove(self[timer]);
return a + (b - a) * y;
}
}
Expand Down

0 comments on commit 1a8ecb7

Please sign in to comment.