1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-15 18:47:38 +00:00
serenity/Userland/Libraries/LibJS/Tests/builtins/JSON
Luke Wilde da25ac0d48 AK: Treat empty string as invalid JSON
Previously we would treat the empty string as `null`. This caused
JavaScript like this to fail:
```js
var object = {};
try {
    object = JSON.parse("");
} catch {}
var array = object.array || [];
```
Since `JSON.parse("")` returned null instead of throwing, it would set
`object` to null and then try and use it instead of using the default
backup value.
2022-07-10 23:31:48 +02:00
..
JSON.@@toStringTag.js
JSON.parse-reviver.js
JSON.parse.js AK: Treat empty string as invalid JSON 2022-07-10 23:31:48 +02:00
JSON.stringify-exception-in-property-getter.js
JSON.stringify-order.js
JSON.stringify-proxy.js
JSON.stringify-replacer.js
JSON.stringify-space.js
JSON.stringify.js