var x = []; x[0x7fffffff]=1; JSON.stringify(x);
var x = []; x[0x7fffffff]=1; JSON.stringify(x);
JSON.stringify
function, which does not allow interrupting the execution in the same firefox, as it usually happens with a simple while(true);
. var x = []; x[0x7fffffff]=1; // 32 JSON.stringify(x); // x , null...
localStorage
. The brain was already thinking tight, and at the beginning a simple array was stored for storage with saving as JSON. After realizing that it would be more convenient to work with ID in this case, the array was replaced with an object, and to generate a random ID, the following code Math.random() * 0x7fffffff >> 0
, then the data was serialized and recorded in the repository. After that, random page hangs began, and during debugging it was discovered that the collection was still initialized as an array.JSON.stringify
bad, but about the fact that you need to be more attentive to what you send to it.Source: https://habr.com/ru/post/279439/
All Articles