@@ -129,7 +129,7 @@ open class WKJavaScriptController: NSObject {
129129 fileprivate func protocolsAdoptedBy( `protocol`: Protocol ) -> [ Protocol ] {
130130 var protocols = [ `protocol`]
131131 let protocolList = protocol_copyProtocolList ( `protocol`, nil )
132- if protocolList != nil , var list = Optional ( protocolList) {
132+ if protocolList != nil , let list = Optional ( protocolList) {
133133 if let adoptedProtocol = list? . pointee. unsafelyUnwrapped {
134134 protocols += protocolsAdoptedBy ( protocol: adoptedProtocol)
135135 }
@@ -149,10 +149,10 @@ open class WKJavaScriptController: NSObject {
149149 while list? . pointee. name != nil {
150150 defer { list = list? . successor ( ) }
151151
152- let selector = list? . pointee. name
153- guard let types = list? . pointee. types,
152+ guard let selector = list? . pointee. name,
153+ let types = list? . pointee. types,
154154 let signature = String ( cString: types, encoding: String . Encoding. utf8) else {
155- log ( " Method signature not found, so it was excluded. (selector: \( selector ) ) " )
155+ log ( " Method signature not found, so it was excluded. (selector: \( list ? . pointee . name ?? " nil " ) ) " )
156156 continue
157157 }
158158
@@ -187,7 +187,7 @@ open class WKJavaScriptController: NSObject {
187187 continue
188188 }
189189
190- let bridge = MethodBridge ( nativeSelector: selector! )
190+ let bridge = MethodBridge ( nativeSelector: selector)
191191 if bridge. argumentLength > limit {
192192 log ( " Argument length is longer than \( limit) , so it was excluded. (selector: \( bridge. nativeSelector) ) " )
193193 continue
0 commit comments