Thanks!

On Thu, Mar 2, 2023 at 2:15 PM 'Gavin Mogan' via Jenkins Developers <
[email protected]> wrote:

> I vaguely remember some javascript code somewhere deleting
> Object.prototype.toJSON() or something
>
> A quick search found
> https://github.com/jenkinsci/jenkins/blob/e41aeaacf434b9ff93c8848f8eddbfcbb27ed462/war/src/main/js/util/jenkins.js#L20-L54
> In theory that makes JSON.stringify work again, but would make the other
> prototype js fail, so would have to be done temporarily.
>
>
> On Thu, Mar 2, 2023 at 1:59 PM Ullrich Hafner <[email protected]>
> wrote:
>
>>
>> Hi!
>> I was looking at some javascript that was behaving differently on Jenkins
>> than it does on other apps. I boiled it down to the simplest reproducible
>> test case.
>> It turned out that serialization was behaving differently when calling
>> JSON.stringify.
>>
>> This is the sample code you can run on the Chrome DevTools
>>
>> JSON.stringify({ a: [1, 2, 3] });
>>
>> On Jenkins, this is the behavior
>>
>> '{"a":"[1, 2, 3]"}'
>>
>> On other apps, this is the behavior
>>
>> '{"a":[1, 2, 3]}'
>>
>> When I attempt to debug the code, stepping into `JSON.stringify` on
>> Jenkins takes me to prototype.js.
>>
>> I've seen some threads here attempting not to rely on prototype.js for
>> functionality, but how far are we from removing it?
>>
>>
>> Very far. A couple of years ago I even tried to upgrade prototype.js to
>> the latest version but failed, since some plugins are depending on
>> prototype.js as well. All UI stuff is tightly coupled to prototype.js, this
>> will be very hard to remove.
>>
>>
>> - Rahul
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/708c6498-e0d4-481e-9ad7-e0a8e5af65ffn%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/708c6498-e0d4-481e-9ad7-e0a8e5af65ffn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-dev/76FFAC15-B00C-4528-8AB1-68ED0E6D7055%40gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-dev/76FFAC15-B00C-4528-8AB1-68ED0E6D7055%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-dev/DR9Rr08fd0Y/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Duv8NOUT%2BzGfEoww2bf11kdNAkkT8HCwG%3DUoRuCB6J5ktQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Duv8NOUT%2BzGfEoww2bf11kdNAkkT8HCwG%3DUoRuCB6J5ktQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAE4RbR4h3-TQoKf5y0e1VFkoKu6zwW5cUW6nJ7R%2BN0QQpamD3g%40mail.gmail.com.

Reply via email to