Description
Chrome version: 32.0.1700.77
moment.js version: 2.5.0
moment-timezone.js version: 0.0.3
Run below code in Chrome browser (multiple page refreshes could be required to reproduce error):
<!DOCTYPE html>
<html>
<head>
<script src="moment.js">
</script>
<script src="moment-timezone.js">
</script>
<script src="moment-timezone-data.js">
</script>
</head>
<body>
<script>
"use strict";
for(var i = 0; i < 100; i++) {
moment(1405461600000);
moment().tz("America/North_Dakota/Beulah");
}
</script>
</body>
</html>
This has something to do with JS execution optimizations. If you change order of properties in moment(), makeMoment() function call to the same as in moment.utc() function:
{
_useUTC : false,
_isUTC : false,
_l : lang,
_i : input,
_f : format,
_strict : strict
}
problem is gone. I think this is bug in Chrome, but you can fix it easily in your library.