Bug 86579

Summary: [V8][Refactoring] Replace throwError("message", XXXError) with throwError(XXXError, "message")
Product: WebKit Reporter: Kentaro Hara <haraken>
Component: WebCore JavaScriptAssignee: Kentaro Hara <haraken>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric.carlson, feature-media-reviews, japhet, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 84074    
Attachments:
Description Flags
Patch
none
Patch none

Description Kentaro Hara 2012-05-15 23:11:12 PDT
This is one of a series of refactoring commented in https://bugs.webkit.org/show_bug.cgi?id=84074#c5

There are two equivalent throwError()s; i.e. throwError("message", XXXError) and throwError(XXXError, "message"). In this bug we replace throwError("message", XXXError) with throwError(XXXError, "message") (except for the case where XXXError == TypeError. throwError("message", TypeError) will be replaced with throwTypeError("message") in a follow-up patch).
Comment 1 Kentaro Hara 2012-05-15 23:15:10 PDT
Created attachment 142161 [details]
Patch
Comment 2 Kentaro Hara 2012-05-15 23:39:55 PDT
Created attachment 142164 [details]
Patch
Comment 3 Adam Barth 2012-05-16 19:35:18 PDT
Comment on attachment 142164 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=142164&action=review

> Source/WebCore/bindings/v8/V8NPObject.cpp:95
> -          return throwError("NPMethod called on non-NPObject", V8Proxy::ReferenceError);
> +            return V8Proxy::throwError(V8Proxy::ReferenceError, "NPMethod called on non-NPObject");

Can we move throwError and the type enumeration out of V8Proxy?
Comment 4 Kentaro Hara 2012-05-16 19:38:11 PDT
(In reply to comment #3)
> > Source/WebCore/bindings/v8/V8NPObject.cpp:95
> > -          return throwError("NPMethod called on non-NPObject", V8Proxy::ReferenceError);
> > +            return V8Proxy::throwError(V8Proxy::ReferenceError, "NPMethod called on non-NPObject");
> 
> Can we move throwError and the type enumeration out of V8Proxy?

Yes, my plan is to refactor a series of throwError()s into throwError(XXXError, "message") or throwTypeError("message"), and then move a set of error-related code to V8Binding.h.
Comment 5 WebKit Review Bot 2012-05-16 20:13:28 PDT
Comment on attachment 142164 [details]
Patch

Clearing flags on attachment: 142164

Committed r117383: <http://trac.webkit.org/changeset/117383>
Comment 6 WebKit Review Bot 2012-05-16 20:13:32 PDT
All reviewed patches have been landed.  Closing bug.