[Webkit-unassigned] [Bug 131240] New: [Bindings] "nullable" sequences support is incomplete

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 4 15:19:18 PDT 2014


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

           Summary: [Bindings] "nullable" sequences support is incomplete
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Bindings
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: tonikitoo at webkit.org
                CC: darin at apple.com


sample foo.idl:

[
    Conditional=XXX,
] interface Foo {
    [RaisesException] void fooIt(sequence<unsigned long>? seq);
}

Generated JSFoo.cpp code:

EncodedJSValue JSC_HOST_CALL jsFooPrototypeFunctionFooIt(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSFoo* castedThis = jsDynamicCast<JSFoo*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSFoo::info());
    Foo& impl = castedThis->impl();
    if (exec->argumentCount() != 1)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    ExceptionCode ec = 0;
    Vector<unsigned> seq(toNativeArray<unsigned>(exec, exec->argument(0)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    impl.fooIt(seq, ec);
    setDOMException(exec, ec);
    return JSValue::encode(jsUndefined());
}

In JSDOMBindings.h, "toNativeArray" bails out early if JSValue's (i.e. argument0) getObject is null, throwing a VM error "Value is not a sequence".

According to WebIDL [1] there is no restriction for nullable sequences.

[1] http://www.w3.org/TR/WebIDL/#dfn-nullable-type

-- 
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