Skip to content

Array.prototype.toJSON requires double parsing after stringify #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
matanshiloah opened this issue Sep 3, 2018 · 1 comment
Closed

Comments

@matanshiloah
Copy link

When prototype.js loads on page, stringifying an array required double parsing to convert back to array.
F.E:
var a = [ 1 ];
var b = JSON.stringify(a); // will output ""[1]"" (string of array to string) instead of "[1]" (array to string)
var c = JSON.parse(b); // will output "[1]" (array to string) instead of [1] (array)
JSON.parse(c); // will output [1] (array).
Found on potora.jp.

@savetheclocktower
Copy link
Collaborator

This is an issue from a very old version of Prototype. Updating to 1.7 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants