When parsing JSON, exceptions can be thrown. For example, an outside force might completely bork the localStorage with invalid values that break the parser. Since these functions are used all over the place, many things can break. For example, after messing up one of the settings, the options page wouldn't add preferences to the page. Wrap the JSON parsing in a try/catch.
GM_setValue should still throw an exception if it can't stringify the value, since we should never be giving it something it can't stringify.
When parsing JSON, exceptions can be thrown. For example, an outside force might completely bork the localStorage with invalid values that break the parser. Since these functions are used all over the place, many things can break. For example, after messing up one of the settings, the options page wouldn't add preferences to the page. Wrap the JSON parsing in a try/catch.
GM_setValue should still throw an exception if it can't stringify the value, since we should never be giving it something it can't stringify.