Blink-in-JS: Change a way private scripts intentionally throw JS errors

Currently when we need to throw JS errors (i.e., Error, TypeError, SyntaxError, RangeError and ReferenceError) from private scripts, we use 'new XXXError'. There is no way to distinguish JS errors intenationally thrown by the private script with JS errors caused by programming mistake of the private script.

In order to distinguish the two types of JS errors, this CL changes a way a private script intentionally throws JS errors. Specifically, the private script needs to use throwException(PrivateScriptJSError.TypeError, "...") if it wants to throw the JS error intentionally. Other JS errors are treated as real JS errors caused by programming mistake. Those errors will be counted in UseCounters in a follow-up CL. This is necessary to measure the healthiness of private script implementations in production such as execCommand-in-JS.

This CL also changes a way to throw DOM exceptions from private scripts.

Before:
throw new DOMExceptionInPrivateScript("IndexSizeError", "...");

After
throwException(PrivateScriptDOMException.IndexSizeError, "...");

BUG=340522

Review URL: https://codereview.chromium.org/531653004

git-svn-id: svn://svn.chromium.org/blink/trunk@181221 bbb929c8-8fbe-4397-9dbb-9b2b20218538