WebDevTmas / moment-round

Plugin for momentjs to round time in dates.
Other
47 stars 75 forks source link

Fix issue if Array has had its prototype extended #1

Closed cjsewell closed 9 years ago

cjsewell commented 9 years ago

In my project I have extended Array like so: Array.prototype.first = function () {}

The loop starting on line 24 also loops prototype extensions, which leads to a "is not a function" error. This patch checks that k is a string before proceeding to use it.

cjsewell commented 9 years ago

Actually, I will close and open a new pull request, I think checking that this._d[...] is a more robust solution

cjsewell commented 9 years ago

Imporved PR here: https://github.com/WebDevTmas/moment-round/pull/2