Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Syntax errors should be thrown before calling reviver in polyfill #4

Open
zloirock opened this issue Jan 28, 2023 · 0 comments
Open

Comments

@zloirock
Copy link

zloirock commented Jan 28, 2023

It's not related to the JSON standard, but for polyfill by the ES spec JSON should be parsed (validated) before calling reviver.

JSON.parse("[1]{", (a, b, c) => console.log("should not be called")); // => "should not be called"

https://tc39.es/ecma262/#sec-json.parse

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

No branches or pull requests

1 participant