File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Sources/JavaScriptKit/FundamentalObjects Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ public class JSOneshotClosure: JSObject, JSClosureProtocol {
103103/// button.removeEventListener!("click", JSValue.function(eventListener))
104104/// ```
105105///
106- public class JSClosure : JSFunction , JSClosureProtocol {
106+ public class JSClosure : JSObject , JSClosureProtocol {
107107
108108 class SharedJSClosure {
109109 // Note: 6.0 compilers built with assertions enabled crash when calling
@@ -165,6 +165,10 @@ public class JSClosure: JSFunction, JSClosureProtocol {
165165 fatalError ( " JSClosure does not support dictionary literal initialization " )
166166 }
167167
168+ override public var jsValue : JSValue {
169+ . function( JSFunction ( id: self . id) )
170+ }
171+
168172 #if compiler(>=5.5) && (!hasFeature(Embedded) || os(WASI))
169173 /// Creates a new `JSClosure` that calls the given Swift function asynchronously.
170174 ///
You can’t perform that action at this time.
0 commit comments