Skip to content

BridgeJS: Well-known symbol properties shouldn't be imported #424

@kateinoigakukun

Description

@kateinoigakukun

Currrently this kind of declaration is generated by ImportTS but it's not a valid Swift code

    var [Symbol.toStringTag]: String {
        get throws(JSException) {
            #if arch(wasm32)
            @_extern(wasm, module: "MyLibrary", name: "bjs_ArrayBuffer_[Symbol.toStringTag]_get")
            func bjs_ArrayBuffer_[Symbol.toStringTag]_get(_ self:Int32)->Int32
            #else
            func bjs_ArrayBuffer_[Symbol.toStringTag]_get(_ self:Int32)->Int32{
                fatalError("Only available on WebAssembly")
            }
            #endif
            let ret = bjs_ArrayBuffer_[Symbol.toStringTag] _get(self.bridgeJSLowerParameter())
            if let error = _swift_js_take_exception() {
                throw error
            }
            return String.bridgeJSLiftReturn(ret)
        }
    }

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