Skip to content

Commit

Permalink
add typecasting from Date to Number for the timeStamp parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
louisremi committed Nov 30, 2011
1 parent 6860843 commit 6460d73
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,9 @@ var Scroller;
throw new Error("Invalid touch list: " + touches);
}

if (timeStamp instanceof Date) {
timeStamp = +timeStamp;
}
if (typeof timeStamp !== "number") {
throw new Error("Invalid timestamp value: " + timeStamp);
}
Expand Down Expand Up @@ -682,6 +685,9 @@ var Scroller;
throw new Error("Invalid touch list: " + touches);
}

if (timeStamp instanceof Date) {
timeStamp = +timeStamp;
}
if (typeof timeStamp !== "number") {
throw new Error("Invalid timestamp value: " + timeStamp);
}
Expand Down Expand Up @@ -859,6 +865,9 @@ var Scroller;
*/
doTouchEnd: function(timeStamp) {

if (timeStamp instanceof Date) {
timeStamp = +timeStamp;
}
if (typeof timeStamp !== "number") {
throw new Error("Invalid timestamp value: " + timeStamp);
}
Expand Down

0 comments on commit 6460d73

Please sign in to comment.