Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8011086 Specification fails (outside test262)
  3. JDK-8011382

Data prototype methods and constructor do not call user defined toISOString, valueOf methods per spec.

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • P4
    • 8
    • None
    • core-libs
    • None
    • b86
    • generic
    • generic
    • Verified

    Description

      Two related issues:

      * Date.prototype.toJSON should call toISOString override by user.
      * Date.prototype.setFOO methods should convert all arguments by ToNumber - which calls user defined valueOf as needed. This should be done even if a specific argument fails to convert. Subsequent args should be converted for possible valueOf side-effects.

      Examples:

      (new Date).setFullYear({valueOf:function(){print("year"); return NaN}}, {valueOf: function(){print("month"); return NaN}})
      => should print "year" and "month"

      (d = new Date(), d.toISOString = function(){return "test"}, d.toJSON())
      => should return "test"

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: