Closed trevnorris closed 4 years ago
@trevnorris Not sure what you’re going for here, but JSONParse
and JSONStringify
do exist and should generally be used rather than grabbing the primordial JSON
and using JSON.parse
and JSON.stringify
on that.
And that would explain why my search for git grep "\<JSON\>" -- lib/
didn't help. Well that solves this issue. Thanks.
On a side note; lib/internal/v8_prof_polyfill.js
still uses JSON.stringify()
in a template literal (possibly why lint doesn't catch it).
Also, might be nice to update lib/.eslintrc.yaml
with better instructions on what to use. Instead of
Use
const { JSON } = primordials;
instead of the global.
The
JSON
object does not appear in theprimordials
list, butmake jslint
will display ano-restricted-globals
error.