WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
93226
[V8] Replace throwError(ExceptionCode, Isolate*) with setDOMException(ExceptionCode, Isolate*) in v8/* and v8/custom/*
https://bugs.webkit.org/show_bug.cgi?id=93226
Summary
[V8] Replace throwError(ExceptionCode, Isolate*) with setDOMException(Excepti...
Kentaro Hara
Reported
2012-08-05 23:08:01 PDT
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".
Attachments
Patch
(27.21 KB, patch)
2012-08-05 23:13 PDT
,
Kentaro Hara
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Kentaro Hara
Comment 1
2012-08-05 23:13:42 PDT
Created
attachment 156600
[details]
Patch
Kentaro Hara
Comment 2
2012-08-05 23:20:07 PDT
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().
Eric Seidel (no email)
Comment 3
2012-08-07 15:20:44 PDT
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?
Kentaro Hara
Comment 4
2012-08-07 15:31:35 PDT
(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.
Kentaro Hara
Comment 5
2012-08-07 16:47:06 PDT
(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.
Eric Seidel (no email)
Comment 6
2012-08-07 21:42:25 PDT
Comment on
attachment 156600
[details]
Patch Are we going to remove throwError(ExceptionCode?) Is that the next patch?
Kentaro Hara
Comment 7
2012-08-07 21:44:18 PDT
(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.
WebKit Review Bot
Comment 8
2012-08-07 22:06:48 PDT
Comment on
attachment 156600
[details]
Patch Clearing flags on attachment: 156600 Committed
r124985
: <
http://trac.webkit.org/changeset/124985
>
WebKit Review Bot
Comment 9
2012-08-07 22:06:52 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug