Bug 133914 - IDL Constructor does not allow too many arguments
Summary: IDL Constructor does not allow too many arguments
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-14 14:07 PDT by Dirk Schulze
Modified: 2015-07-03 14:17 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Schulze 2014-06-14 14:07:03 PDT
[
    Conditional=GEOMETRY,
    Constructor,
    Constructor(Dictionary point),
    Constructor(unrestricted double x, unrestricted double y),
    Constructor(unrestricted double x, unrestricted double y, unrestricted double z),
    Constructor(unrestricted double x, unrestricted double y, unrestricted double z, unrestricted double w)
] interface DOMPoint : DOMPointReadOnly {

Code generator makes every check equal check. Last check should be >=:

    size_t argsCount = exec->argumentCount();
    if (argsCount == 0)
        return JSDOMPointConstructor::constructJSDOMPoint1(exec);
    if (argsCount == 1)
        return JSDOMPointConstructor::constructJSDOMPoint2(exec);
    if (argsCount == 2)
        return JSDOMPointConstructor::constructJSDOMPoint3(exec);
    if (argsCount == 3)
        return JSDOMPointConstructor::constructJSDOMPoint4(exec);
    if (argsCount == 4)
        return JSDOMPointConstructor::constructJSDOMPoint5(exec);
    return throwVMTypeError(exec);
Comment 1 Daniel Bates 2015-07-03 14:16:44 PDT
This bug is fixed with the patch for bug #136134. That is, we emit code to ignore extra arguments per <http://www.w3.org/TR/2012/CR-WebIDL-20120419/#es-interface-call>.
Comment 2 Daniel Bates 2015-07-03 14:17:42 PDT
(In reply to comment #1)
> This bug is fixed with the patch for bug #136134. That is, we emit code to
> ignore extra arguments per
> <http://www.w3.org/TR/2012/CR-WebIDL-20120419/#es-interface-call>.

err, I meant bug #146515.