Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c07db3d commit be1f916Copy full SHA for be1f916
1 file changed
Sources/JavaScriptKit/BasicObjects/JSTypedArray.swift
@@ -39,7 +39,8 @@ public class JSTypedArray<Element>: JSValueConvertible, ExpressibleByArrayLitera
39
self.init(unsafe: jsObject)
40
}
41
42
- public init(objectRef jsObject: JSObjectRef) {
+ public init?(objectRef jsObject: JSObjectRef) {
43
+ guard jsObject.isInstanceOf(Element.typedArrayClass) else { return nil }
44
_retain(jsObject.id)
45
super.init(id: jsObject.id)
46
0 commit comments