timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-25152] Prototype adds Array.prototype.toJSON() that breaks JSON.stringify #5554

Open timja opened 9 years ago

timja commented 9 years ago

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.


Originally reported by kohsuke, imported from: Prototype adds Array.prototype.toJSON() that breaks JSON.stringify
  • status: Open
  • priority: Major
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 9 years ago

danielbeck:

Is this a duplicate of JENKINS-15526?

timja commented 9 years ago

oleg_nenashev:

Seems so

timja commented 2 years ago

[Duplicates: JENKINS-15526]