query re: polyfilling json.parse #615
Replies: 3 comments 2 replies
|
For context on my query; Node has had json.parse since 2013; https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#browser_compatibility |
|
Node.js didn’t exist when that was added and browser support wasn’t a given either when we started out. Also I think feature parity with PHP requires allowing flags to change behavior that JSON.parse doesn’t support. doesn’t the function have some disclaimers around this and when not to use it? It should I think |
|
Thanks for the detailed report. I dug a bit into it and you were right to flag this. I checked the I shipped
Release: https://github.com/locutusjs/locutus/releases/tag/v3.0.35 The Could you retry with import { sprintf } from 'locutus/php/strings/sprintf'If JSON still shows up from that direct import path, a small Rolldown repro would be very useful. |
Uh oh!
There was an error while loading. Please reload this page.
I'm curious as to why
json_decodehas a polyfill for json.parse, are there supported environments where json.parse does not exist?All reactions