Bug 102114 - Rename NATIVE_TYPE_ERR to TypeError
Summary: Rename NATIVE_TYPE_ERR to TypeError
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joshua Bell
URL:
Keywords:
Depends on: 91679
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-13 11:54 PST by Joshua Bell
Modified: 2012-11-14 12:23 PST (History)
9 users (show)

See Also:


Attachments
Patch (34.75 KB, patch)
2012-11-13 12:03 PST, Joshua Bell
no flags Details | Formatted Diff | Diff
Patch (33.79 KB, patch)
2012-11-13 13:37 PST, Joshua Bell
no flags Details | Formatted Diff | Diff
Patch for landing (33.66 KB, patch)
2012-11-14 11:47 PST, Joshua Bell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Bell 2012-11-13 11:54:23 PST
Rename NATIVE_TYPE_ERR to TypeError
Comment 1 Joshua Bell 2012-11-13 12:03:45 PST
Created attachment 173945 [details]
Patch
Comment 2 Joshua Bell 2012-11-13 12:07:06 PST
Comment on attachment 173945 [details]
Patch

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

> Source/WebCore/bindings/v8/V8ThrowException.h:32
> +enum V8ErrorType {

Prefixing "ErrorType" itself is not strictly necessary, but there seems to be precedent for prefix consistency between enum and members.

> Source/WebCore/dom/Element.cpp:-1523
> -        ec = NATIVE_TYPE_ERR;

These need to be switched to TYPE_MISMATCH_ERR in another patch. Uploading here for now to exercise build bots.

> Source/WebCore/dom/Element.cpp:-1565
> -        ec = NATIVE_TYPE_ERR;

Ditto.

> Source/WebCore/dom/ExceptionCode.h:68
> +        // WebIDL exception types, handled by the binding layer.

I don't know if we should add all of these now given that they're unused/untested. But I wanted to see if the build bots are happy with these names.
Comment 3 Erik Arvidsson 2012-11-13 12:07:21 PST
Comment on attachment 173945 [details]
Patch

LGTM... I would r+ if I was a reviewere
Comment 4 Joshua Bell 2012-11-13 13:37:45 PST
Created attachment 173974 [details]
Patch
Comment 5 Kentaro Hara 2012-11-13 15:40:13 PST
Comment on attachment 173974 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        V8 binding code had colliding enum members, which required prefixing.

For consistency I want to make the same change for JSC too. SyntaxError -> jsSyntaxError
Comment 6 Joshua Bell 2012-11-13 15:44:17 PST
Comment on attachment 173974 [details]
Patch

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

>> Source/WebCore/ChangeLog:9
>> +        V8 binding code had colliding enum members, which required prefixing.
> 
> For consistency I want to make the same change for JSC too. SyntaxError -> jsSyntaxError

I didn't find a similar enum in the JSC code. Can you point me at what would need updating?
Comment 7 Kentaro Hara 2012-11-13 15:45:56 PST
(In reply to comment #6)
> I didn't find a similar enum in the JSC code. Can you point me at what would need updating?

Ah, JSC uses createSyntaxError() etc instead of enums. Sorry, ignore my comment.
Comment 8 Joshua Bell 2012-11-13 15:48:17 PST
Comment on attachment 173974 [details]
Patch

Thanks. Going ahead with claiming WebCore::GeneralError, WebCore::RangeError etc. in the ExceptionCode enum, even though the types aren't handled by binding code yet.
Comment 9 Darin Adler 2012-11-13 17:34:37 PST
Comment on attachment 173974 [details]
Patch

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

> Source/WebCore/dom/ExceptionCode.h:75
> +        GeneralError = 100,
> +        EvalError = 101,
> +        RangeError = 102,
> +        ReferenceError = 103,
> +        SyntaxError = 104,
> +        TypeError = 105,
> +        URIError = 106,

I agree that we might want to add these some day, but it seems a little dangerous to add them all now when they are not implemented in the bindings.
Comment 10 Joshua Bell 2012-11-14 11:47:24 PST
Created attachment 174215 [details]
Patch for landing
Comment 11 WebKit Review Bot 2012-11-14 12:23:15 PST
Comment on attachment 174215 [details]
Patch for landing

Clearing flags on attachment: 174215

Committed r134646: <http://trac.webkit.org/changeset/134646>
Comment 12 WebKit Review Bot 2012-11-14 12:23:19 PST
All reviewed patches have been landed.  Closing bug.