New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending the prototype #8074
Comments
The blame says: "fixes #2929 - workaround Chrome suckage" From http://forums.thedailywtf.com/forums/p/24374/253916.aspx#253916
Does it cause any problems for you or just in general? |
@diosmosis is working on #2041 which is related in the sense, that maybe the Ping/heatbeat timer code will be cleaned up (ie. removed!) from the piwik.js. if this code can be completely removed then maybe it would be best way to solve the issue |
Hum, it works as expected today with Chrome, (webkit too). var s = e = new Date();
for( var i = 0; e.getTime() - s.getTime() < 500; i++)
{
e = new Date();
}
Wed Jun 10 2015 08:33:49 GMT+0200 (CEST)
var s = e = new Date();
while (e.getTime() - s.getTime() < 1)
{
e = new Date();
}
Wed Jun 10 2015 08:34:00 GMT+0200 (CEST)
var s = e = new Date();
while (e.getTime() - s.getTime() < 500)
{
e = new Date();
}
Wed Jun 10 2015 08:34:08 GMT+0200 (CEST) @tsteur The promblem ? Date.prototype.getTimeAlias... |
We'd need to figure out which Chrome versions are effected by that but since Chrome updates automatically does versions shouldn't be used anymore. I reckon we could also do something like function getCurrentTime() {
var now = new Date();
now.getTimeAlias = now.getTime;
return now.getTimeAlias();
}
do {
// could be also done here instead of in getCurrentTime
} while (getCurrentTime() < expireDateTime); |
Feel free to submit a pull request 👍 |
Maybe we can follow the comment: if (expireDateTime) {
// the things we do for backwards compatibility...
// in ECMA-262 5th ed., we could simply use:
// while (Date.now() < expireDateTime) { }
do {
now = new Date();
} while (now.getTimeAlias() < expireDateTime);
} And use |
Hi,
Inside
Piwik.js
there isDate.prototype.getTimeAlias = Date.prototype.getTime;
(L 5381) why ?We can only find one call to this alias (L641):
Can we remove it and use getTime and keep the prototype clean ?
Edit:
We can find getTime :)
...
The text was updated successfully, but these errors were encountered: