Bug 94790 - Derived JS binding code throws a different exception than the normal one for overloaded functions when argument count is not enough
Summary: Derived JS binding code throws a different exception than the normal one for ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-23 01:43 PDT by Xiaobo Wang
Modified: 2012-08-24 02:02 PDT (History)
9 users (show)

See Also:


Attachments
patch (8.18 KB, patch)
2012-08-23 01:53 PDT, Xiaobo Wang
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from gce-cr-linux-08 (430.14 KB, application/zip)
2012-08-23 02:30 PDT, WebKit Review Bot
no flags Details
patch wich V8 update (10.75 KB, patch)
2012-08-23 06:06 PDT, Xiaobo Wang
haraken: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from gce-cr-linux-08 (444.14 KB, application/zip)
2012-08-23 06:50 PDT, WebKit Review Bot
no flags Details
patch revision 3 (31.20 KB, patch)
2012-08-24 00:49 PDT, Xiaobo Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaobo Wang 2012-08-23 01:43:21 PDT
Observed by 2 failed DRT tests if MEDIA_STREAM is enabled.
  fast/files/create-blob-url-crash.html
  fast/files/url-required-arguments.html

The reason is DOMURL::createObjectURL() is a overloaded when MEDIA_STREAM is enabled. A dispatching function is added for overloaded functions, and it doesn't check argument count if failed to dispatch the call to one of the overloaded functions.

Chromium and Gtk face the same issue but they created platform specific expected files for the 2 tests. I think a better solution is to fix the issue in the code generator, so that all platforms can share the same expected files.

Even if we only consider one platform, for example BlackBerry, it's possible we enable or disable MEDIA_STREAM explicitly when building WebKit. If we just change the expected result for the ENABLED scenario, the tests will still fail for the other scenario (DISABLE scenario).
Comment 1 Xiaobo Wang 2012-08-23 01:53:08 PDT
Created attachment 160116 [details]
patch
Comment 2 Kentaro Hara 2012-08-23 02:14:22 PDT
Comment on attachment 160116 [details]
patch

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

> Source/WebCore/ChangeLog:8
> +        Throw NotEnoughArguments exception for overloaded functions if actualrgument

Typo: actual argument

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1336
> +    my $leastNumMandatoryParams = 255;

Where does 255 come from?
Comment 3 Xiaobo Wang 2012-08-23 02:27:52 PDT
(In reply to comment #2)
> (From update of attachment 160116 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=160116&action=review
> 
> > Source/WebCore/ChangeLog:8
> > +        Throw NotEnoughArguments exception for overloaded functions if actualrgument
> 
> Typo: actual argument
Oops, sorry for the typo.

> 
> > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1336
> > +    my $leastNumMandatoryParams = 255;
> 
> Where does 255 come from?
Just want to initialize variable $leastNumMandatoryParams with a number big enough for argument count, do you think 255 is a reasonable number?
Comment 4 WebKit Review Bot 2012-08-23 02:30:42 PDT
Comment on attachment 160116 [details]
patch

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

New failing tests:
fast/files/url-required-arguments.html
fast/files/create-blob-url-crash.html
Comment 5 WebKit Review Bot 2012-08-23 02:30:44 PDT
Created attachment 160118 [details]
Archive of layout-test-results from gce-cr-linux-08

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-08  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Comment 6 Kentaro Hara 2012-08-23 02:39:22 PDT
Comment on attachment 160116 [details]
patch

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

Why don't we need the same fix in CodeGeneratorV8.pm?

>>> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1336
>>> +    my $leastNumMandatoryParams = 255;
>> 
>> Where does 255 come from?
> 
> Just want to initialize variable $leastNumMandatoryParams with a number big enough for argument count, do you think 255 is a reasonable number?

Nit: OK. I was just curious.
Comment 7 Xiaobo Wang 2012-08-23 06:06:54 PDT
Created attachment 160142 [details]
patch wich V8 update
Comment 8 Kentaro Hara 2012-08-23 06:19:46 PDT
Comment on attachment 160142 [details]
patch wich V8 update

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

The change looks OK. I think you need to update ./run-binding-tests results. See here:
https://trac.webkit.org/wiki/WebKitIDL#RunBindingsTests

> Source/WebCore/ChangeLog:8
> +        Throw NotEnoughArguments exception for overloaded functions if actualrgument

Typo: actual argument
Comment 9 WebKit Review Bot 2012-08-23 06:50:27 PDT
Comment on attachment 160142 [details]
patch wich V8 update

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

New failing tests:
storage/indexeddb/transaction-and-objectstore-calls.html
platform/chromium/virtual/gpu/fast/canvas/canvas-overloads-setStrokeColor.html
fast/canvas/canvas-overloads-setShadow.html
storage/indexeddb/transaction-storeNames-required.html
platform/chromium/virtual/gpu/fast/canvas/canvas-overloads-setFillColor.html
storage/indexeddb/objectStore-required-arguments.html
fast/canvas/canvas-overloads-setFillColor.html
fast/canvas/canvas-overloads-setStrokeColor.html
fast/canvas/canvas-overloads-drawImage.html
storage/indexeddb/index-get-key-argument-required.html
platform/chromium/virtual/gpu/fast/canvas/canvas-overloads-setShadow.html
fast/canvas/webgl/texImageTest.html
platform/chromium/virtual/gpu/fast/canvas/canvas-overloads-drawImage.html
platform/chromium/virtual/gpu/fast/canvas/webgl/texImageTest.html
Comment 10 WebKit Review Bot 2012-08-23 06:50:30 PDT
Created attachment 160152 [details]
Archive of layout-test-results from gce-cr-linux-08

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-08  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Comment 11 Xiaobo Wang 2012-08-24 00:47:16 PDT
(In reply to comment #8)
> (From update of attachment 160142 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=160142&action=review
> 
> The change looks OK. I think you need to update ./run-binding-tests results. See here:
> https://trac.webkit.org/wiki/WebKitIDL#RunBindingsTests
> 
> > Source/WebCore/ChangeLog:8
> > +        Throw NotEnoughArguments exception for overloaded functions if actualrgument
> 
> Typo: actual argument

Thanks for the reminder. I'll update binding results.
Comment 12 Xiaobo Wang 2012-08-24 00:49:44 PDT
Created attachment 160353 [details]
patch revision 3

Updated failed DRT tests.
Updated JS/V8 binding tests result.
Comment 13 Kentaro Hara 2012-08-24 00:51:12 PDT
Comment on attachment 160353 [details]
patch revision 3

Looks OK
Comment 14 WebKit Review Bot 2012-08-24 02:02:37 PDT
Comment on attachment 160353 [details]
patch revision 3

Clearing flags on attachment: 160353

Committed r126562: <http://trac.webkit.org/changeset/126562>
Comment 15 WebKit Review Bot 2012-08-24 02:02:41 PDT
All reviewed patches have been landed.  Closing bug.