Bug 115477 - handle enum in overloaded methods
Summary: handle enum in overloaded methods
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: arno.
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-01 10:26 PDT by arno.
Modified: 2015-11-11 10:01 PST (History)
7 users (show)

See Also:


Attachments
patch proposal (5.24 KB, patch)
2013-05-01 10:35 PDT, arno.
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description arno. 2013-05-01 10:26:12 PDT
Hi,
currently, enum are not handled correctly in overloaded methods:
The check done is:
The binding try to check if argument is an object of type whateverEnum.
Instead, it should check if it's a string.
Comment 1 arno. 2013-05-01 10:35:52 PDT
Created attachment 200220 [details]
patch proposal
Comment 2 Geoffrey Garen 2013-05-01 11:26:21 PDT
Can you give an example of how this will be used?

Why do we want to use strings for enumerated values, instead of numbers?
Comment 3 Kentaro Hara 2013-05-01 11:29:25 PDT
> Why do we want to use strings for enumerated values, instead of numbers?

Because it's speced: http://dev.w3.org/2006/webapi/WebIDL/#idl-enums

> Can you give an example of how this will be used?

arno: Enum is used more and more in the spec (but is poorly supported in WebKit and Blink), so your patch basically looks good. What use case do you have in mind?
Comment 4 arno. 2013-05-01 11:30:46 PDT
(In reply to comment #3)

> arno: Enum is used more and more in the spec (but is poorly supported in WebKit and Blink), so your patch basically looks good. What use case do you have in mind?

the overloaded fill method of canvas2d:
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#2dcontext
Comment 5 Anders Carlsson 2015-11-11 10:01:28 PST
Comment on attachment 200220 [details]
patch proposal

This patch hasn't been touched in over 2.5 years, so I think we can go ahead and clear the review flag now.