Bug 102770 - [V8] Move IsConstruct() checks of overloaded constructors to a better place
Summary: [V8] Move IsConstruct() checks of overloaded constructors to a better place
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 102763
  Show dependency treegraph
 
Reported: 2012-11-19 22:28 PST by Kentaro Hara
Modified: 2012-11-20 05:45 PST (History)
4 users (show)

See Also:


Attachments
Patch (7.30 KB, patch)
2012-11-19 22:29 PST, Kentaro Hara
haraken: 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 Kentaro Hara 2012-11-19 22:28:29 PST
This is an incremental refactoring to introduce constructorCallbackCustom(). See bug 102763.
Comment 1 Kentaro Hara 2012-11-19 22:29:50 PST
Created attachment 175142 [details]
Patch
Comment 2 Adam Barth 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.
Comment 3 WebKit Review Bot 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
Comment 4 Kentaro Hara 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.
Comment 5 Adam Barth 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.