• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      new Date(NaN).setFullYear(NaN)
      => currently throws java.lang.NullPointerException

      new Date(0).setYear(70)
      => should return 0

      new Date(0).setYear(NaN)
      => should return NaN

      new Date(NaN).setYear(70)
      => should return the new time value

      new Date(NaN).getTimezoneOffset()
      => should return NaN

      Date.prototype.setTime.call({},{valueOf:function(){throw "err"}})
      => should throw a TypeError instead of "err"

      new Date(NaN).setMilliseconds({valueOf:function(){throw "err"}})
      => should throw "err"

      Same bug with the following functions:
      Date.prototype.setUTCMilliseconds
      Date.prototype.setSeconds
      Date.prototype.setUTCSeconds
      Date.prototype.setMinutes
      Date.prototype.setUTCMinutes
      Date.prototype.setHours
      Date.prototype.setUTCHours
      Date.prototype.setDate
      Date.prototype.setUTCDate
      Date.prototype.setMonth
      Date.prototype.setUTCMonth

            sundar Sundararajan Athijegannathan
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: