[Webkit-unassigned] [Bug 71503] New: Remove RequiresAllArguments

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 3 13:45:12 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=71503

           Summary: Remove RequiresAllArguments
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore JavaScript
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: arv at chromium.org
                CC: abarth at webkit.org, pilgrim at chromium.org


All method arguments are now required by default. We can annotate optional arguments using [Optional], [Optional=CallWithDefaultValue] and [Optional=CallWithNullValue]

Annotating a method with [RequiresAllArguments=Raise] throws a TypeError when arguments are missing. This is the default behavior of all methods. [RequiresAllArguments=Raise] is not used anywhere.

Annotating a method with [RequiresAllArguments] makes the method return undefined if any argument is missing.

Source/WebCore/dom/Clipboard.idl:        // FIXME: RequiresAllArguments is probably bogus here.
Source/WebCore/dom/Clipboard.idl:        [RequiresAllArguments] boolean setData(in DOMString type, in DOMString data);
Source/WebCore/page/DOMWindow.idl:        [RequiresAllArguments] void scrollBy(in long x, in long y);
Source/WebCore/page/DOMWindow.idl:        [RequiresAllArguments] void scrollTo(in long x, in long y);
Source/WebCore/page/DOMWindow.idl:        [RequiresAllArguments] void scroll(in long x, in long y);
Source/WebCore/page/DOMWindow.idl:        [RequiresAllArguments] void moveBy(in float x, in float y); // FIXME: this should take longs not floats.
Source/WebCore/page/DOMWindow.idl:        [RequiresAllArguments] void moveTo(in float x, in float y); // FIXME: this should take longs not floats.
Source/WebCore/page/DOMWindow.idl:        [RequiresAllArguments] void resizeBy(in float x, in float y); // FIXME: this should take longs not floats.
Source/WebCore/page/DOMWindow.idl:        [RequiresAllArguments] void resizeTo(in float width, in float height); // FIXME: this should take longs not floats.
Source/WebCore/websockets/WebSocket.idl:        // [RequiresAllArguments] boolean send(in ArrayBuffer data) raises(DOMException);
Source/WebCore/websockets/WebSocket.idl:        // [RequiresAllArguments] boolean send(in Blob data) raises(DOMException);
Source/WebCore/websockets/WebSocket.idl:        // [RequiresAllArguments] boolean send(in DOMString data) raises(DOMException);

It seems like we could change the DOMWindow methods to just use [Optional] and not do anything in case not enough arguments are passed.

Another option is to keep [RequiresAllArguments] (but not [RequiresAllArguments=Raise]) and rename it to something more correct.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list