Bug 66045 - The code generators behave differently for overloaded and non-overloaded functions
Summary: The code generators behave differently for overloaded and non-overloaded func...
Status: RESOLVED LATER
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Tommy Widenflycht
URL:
Keywords:
Depends on:
Blocks: 56459 65925
  Show dependency treegraph
 
Reported: 2011-08-11 04:08 PDT by Tommy Widenflycht
Modified: 2012-04-02 02:20 PDT (History)
6 users (show)

See Also:


Attachments
Patch (7.26 KB, patch)
2011-08-11 04:48 PDT, Tommy Widenflycht
abarth: review-
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommy Widenflycht 2011-08-11 04:08:31 PDT
Make the code generator for overloaded functions to behave more like non-overloaded functions regarding missing parameters.

If one has just this in the IDL:

TYPE function(in TYPE1 arg1)

the generated code throws a specialized type error "Not enough parameters" if one calls function without any parameters.


If one has this in the IDL:

TYPE function(in TYPE1 arg)
TYPE function(in TYPE2 arg)

and calls function without any parameters the generated code throws just a generic TypeError.

This patch counts the number of mandatory parameters for each overloaded function and if the number of arguments is less than the smallest of them throws the specialized type error, otherwise the generic.
Comment 1 Tommy Widenflycht 2011-08-11 04:48:18 PDT
Created attachment 103600 [details]
Patch
Comment 2 WebKit Review Bot 2011-08-11 05:25:27 PDT
Comment on attachment 103600 [details]
Patch

Attachment 103600 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9352159

New failing tests:
fast/canvas/canvas-overloads-setFillColor.html
fast/canvas/canvas-overloads-setStrokeColor.html
fast/canvas/canvas-overloads-setShadow.html
fast/canvas/canvas-overloads-drawImage.html
fast/canvas/webgl/texImageTest.html
Comment 3 Adam Barth 2011-08-11 09:53:11 PDT
Comment on attachment 103600 [details]
Patch

Looks like landing this patch would cause test failures.  It looks like a good approach, however.
Comment 4 Tommy Widenflycht 2011-08-22 03:51:41 PDT
Do you think I should go ahead with this patch, even though it breaks several tests? (Of course I will fix the tests).
Comment 5 Adam Barth 2011-08-22 10:24:46 PDT
We need to look at how our behavior is changing on those tests and decide whether the new behavior is better or worse than the old behavior.  For example, is our new behavior more or less consistent with the specifications and other browsers?  Is the change likely to cause compatibility problems?
Comment 6 Philippe Normand 2011-09-20 04:50:29 PDT
I skipped fast/files/create-blob-url-crash.html on GTK in http://trac.webkit.org/changeset/95528. It'd be great if the test could be unskipped when this bug is fixed.
Comment 7 Philippe Normand 2011-10-19 04:59:20 PDT
(In reply to comment #6)
> I skipped fast/files/create-blob-url-crash.html on GTK in http://trac.webkit.org/changeset/95528. It'd be great if the test could be unskipped when this bug is fixed.

fast/files/url-required-arguments.html is also affected by this issue... Skipping in GTK like the test above.