RESOLVED WONTFIX102770
[V8] Move IsConstruct() checks of overloaded constructors to a better place
https://bugs.webkit.org/show_bug.cgi?id=102770
Summary [V8] Move IsConstruct() checks of overloaded constructors to a better place
Kentaro Hara
Reported 2012-11-19 22:28:29 PST
This is an incremental refactoring to introduce constructorCallbackCustom(). See bug 102763.
Attachments
Patch (7.30 KB, patch)
2012-11-19 22:29 PST, Kentaro Hara
haraken: review-
webkit.review.bot: commit-queue-
Kentaro Hara
Comment 1 2012-11-19 22:29:50 PST
Adam Barth
Comment 2 2012-11-19 23:41:35 PST
Comment on attachment 175142 [details] Patch Ok. This seems to increase the amount of code we generate slightly, but I'm willing to go with it.
WebKit Review Bot
Comment 3 2012-11-20 00:24:11 PST
Comment on attachment 175142 [details] Patch Attachment 175142 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/14919013 New failing tests: fast/dom/call-a-constructor-as-a-function.html
Kentaro Hara
Comment 4 2012-11-20 00:55:29 PST
Comment on attachment 175142 [details] Patch > fast/dom/call-a-constructor-as-a-function.html This patch is wrong. We need to check if we're in a constructor or not before sorting overloaded constructor callbacks. Otherwise, we cannot distinguish 'WebSocket()' from 'new WebSocket()'. 'WebSocket()' should be 'Constructor cannot be called as a function' error, and 'new WebSocket()' should be 'Not enough arguments' error.
Adam Barth
Comment 5 2012-11-20 01:28:58 PST
I see. We need to complain about being called as a function (rather than a constructor) before we figure out if we've got the right parameters.
Note You need to log in before you can comment on or make changes to this bug.