File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -671,15 +671,16 @@ extension IDLType: SwiftRepresentable {
671
671
// TODO: handle readonly closure properties
672
672
// (should they be a JSFunction? or a closure? or something else?))
673
673
if case let . single( name) = value {
674
- precondition ( !readonly, " readonly closure properties are not supported " )
675
674
if let callback = ModuleState . types [ name] as? IDLCallback {
675
+ precondition ( !readonly, " readonly closure properties are not supported " )
676
676
return " \( closureWrapper ( callback, optional: false ) ) "
677
677
}
678
678
if let ref = ModuleState . types [ name] as? IDLTypedef ,
679
679
case let . single( name) = ref. idlType. value,
680
680
let callback = ModuleState . types [ name] as? IDLCallback
681
681
{
682
- assert ( ref. idlType. nullable)
682
+ precondition ( !readonly, " readonly closure properties are not supported " )
683
+ precondition ( ref. idlType. nullable)
683
684
return " \( closureWrapper ( callback, optional: true ) ) "
684
685
}
685
686
}
You can’t perform that action at this time.
0 commit comments