Bug 67381 - TypeError should be thrown when we call a constructor as a normal function
Summary: TypeError should be thrown when we call a constructor as a normal function
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 65839
  Show dependency treegraph
 
Reported: 2011-09-01 03:02 PDT by Kentaro Hara
Modified: 2011-09-07 11:49 PDT (History)
6 users (show)

See Also:


Attachments
Patch (22.06 KB, patch)
2011-09-01 03:32 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff
Patch (22.13 KB, patch)
2011-09-01 07:36 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff
Patch (22.08 KB, patch)
2011-09-01 10:26 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2011-09-01 03:02:52 PDT
Some of V8's custom constructors throw SyntaxError when we call them as a normal function. For example, "FormData()" and "ArrayBuffer()" throw SyntaxError. However, the spec says that this should be TypeError (http://www.w3.org/TR/WebIDL/#es-interface-call). JSC's custom constructors are correct.
Comment 1 Kentaro Hara 2011-09-01 03:32:15 PDT
Created attachment 105933 [details]
Patch
Comment 2 WebKit Review Bot 2011-09-01 03:58:07 PDT
Comment on attachment 105933 [details]
Patch

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

New failing tests:
fast/dom/call-a-constructor-as-a-function.html
Comment 3 Kentaro Hara 2011-09-01 07:36:29 PDT
Created attachment 105959 [details]
Patch
Comment 4 Darin Adler 2011-09-01 09:56:52 PDT
Comment on attachment 105959 [details]
Patch

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

> LayoutTests/ChangeLog:13
> +        * platform/mac/fast/dom/call-a-constructor-as-a-function-expected.txt: Added. The test result for JSC.

JSC results should be the default results, not the “Mac” results.
Comment 5 Kentaro Hara 2011-09-01 10:26:06 PDT
Created attachment 105987 [details]
Patch
Comment 6 Kentaro Hara 2011-09-01 10:27:38 PDT
Comment on attachment 105959 [details]
Patch

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

>> LayoutTests/ChangeLog:13
>> +        * platform/mac/fast/dom/call-a-constructor-as-a-function-expected.txt: Added. The test result for JSC.
> 
> JSC results should be the default results, not the “Mac” results.

Moved the result to fast/dom/call-a-constructor-as-a-function-expected.txt
Comment 7 WebKit Review Bot 2011-09-01 16:05:55 PDT
Comment on attachment 105987 [details]
Patch

Clearing flags on attachment: 105987

Committed r94357: <http://trac.webkit.org/changeset/94357>
Comment 8 WebKit Review Bot 2011-09-01 16:06:00 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Ryosuke Niwa 2011-09-07 10:18:14 PDT
Rebaselined GTK+ results for it implements PeerConnection.
Comment 10 Ryosuke Niwa 2011-09-07 10:18:55 PDT
Oops, rebaseline was done in http://trac.webkit.org/changeset/94680.
Comment 11 Eric Seidel (no email) 2011-09-07 11:43:53 PDT
fast/dom/call-a-constructor-as-a-function.html was made a gtk-only result and is now failing on Mac?
Comment 12 Ryosuke Niwa 2011-09-07 11:49:00 PDT
(In reply to comment #11)
> fast/dom/call-a-constructor-as-a-function.html was made a gtk-only result and is now failing on Mac?

Yeah, fixed it in http://trac.webkit.org/changeset/94684.