Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-25152

Prototype adds Array.prototype.toJSON() that breaks JSON.stringify

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • None

      Inside Jenkins, JSON.stringify([1,2]) returns ""[1,2]"" (string that has " as the first char), instead of "[1,2]" (string that has '[' as the first char)

      This is because JSON.stringify consults toJSON methods on objects, and Prototype adds toJSON method on Array.

      I'm not sure how to resolve this aside from overriding JSON.stringify() with Prototype's Object.toJSON.

            Unassigned Unassigned
            kohsuke Kohsuke Kawaguchi
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: