Skip to content

Arguments in JSClosure #155

Closed
Closed
@mhavu

Description

@mhavu

How is one supposed to use arguments in JSClosure? Is it necessary to unpack them manually from the JSValue array? If I try to do that, I get an error message about ambiguous use of subscript(dynamicMember:):

JSClosure { (arguments: [JSValue]) in
    guard let item = arguments.first,  let deviceId = item.string else {
        // item in item.string causes error: ambiguous use of 'subscript(dynamicMember:)'
        return .undefined
    }
    // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions