Now throwError(ExceptionCode, Isolate*) is equivalent to setDOMException(ExceptionCode, Isolate*). We can replace the former with the latter. After this replacement, the rule becomes simple and sane: "Use throwError() for throwing JavaScript errors, use setDOMException() for throwing DOM exceptions".
Created attachment 156600 [details] Patch
I couldn't replace throwError(ExceptionCode) with setDOMException(ExceptionCode, Isolate*) in V8Utilities::extractTransferables(), because extractTransferables() does not know an Isolate. I will upload follow-up patches to pass an Isolate to Dictionary, and then to extractTransferables().
I'm not sure I understand the goal here. I thought we were getting rid of V8Proxy? Isn't throwError the function name used in the JSC bindings? Don't we want to continue making the two codebases more similar?
(In reply to comment #3) > I thought we were getting rid of V8Proxy? Yes. I am removing unnecessary V8Proxy methods for that goal. > Isn't throwError the function name used in the JSC bindings? Don't we want to continue making the two codebases more similar? V8Proxy::throwError(ErrorType, const char* message, Isolate*) still exists, and only this throwError() should exist (i.e. throwError(ExceptionCode, Isolate*) should be gone away). Currently, DOM exceptions are thrown sometimes by throwError(ExceptionCode, Isolate*) and sometimes by setDOMException(ExceptionCode), which is inconsistent. By replacing throwError(ExceptionCode, Isolate*) with setDOMException(ExceptionCode, Isolate*), the code becomes consistent. In other words, we can use throwError(ErrorType, const char* message, Isolate*) for throwing JavaScript errors and use setDOMException(ExceptionCode, Isolate*) for throwing DOM exceptions.
(In reply to comment #4) > > Isn't throwError the function name used in the JSC bindings? Don't we want to continue making the two codebases more similar? > > we can use throwError(ErrorType, const char* message, Isolate*) for throwing JavaScript errors and use setDOMException(ExceptionCode, Isolate*) for throwing DOM exceptions. And I would point out that JSC already follows the rule; i.e. throwError() for JavaScript errors and setDOMException() for DOM exceptions.
Comment on attachment 156600 [details] Patch Are we going to remove throwError(ExceptionCode?) Is that the next patch?
(In reply to comment #6) > (From update of attachment 156600 [details]) > Are we going to remove throwError(ExceptionCode?) Is that the next patch? Will be in the next of the next patch:) There is a subtle issue around Isolate and I need to solve it first.
Comment on attachment 156600 [details] Patch Clearing flags on attachment: 156600 Committed r124985: <http://trac.webkit.org/changeset/124985>
All reviewed patches have been landed. Closing bug.