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 {
103
103
/// button.removeEventListener!("click", JSValue.function(eventListener))
104
104
/// ```
105
105
///
106
- public class JSClosure : JSFunction , JSClosureProtocol {
106
+ public class JSClosure : JSObject , JSClosureProtocol {
107
107
108
108
class SharedJSClosure {
109
109
// Note: 6.0 compilers built with assertions enabled crash when calling
@@ -165,6 +165,10 @@ public class JSClosure: JSFunction, JSClosureProtocol {
165
165
fatalError ( " JSClosure does not support dictionary literal initialization " )
166
166
}
167
167
168
+ override public var jsValue : JSValue {
169
+ . function( JSFunction ( id: self . id) )
170
+ }
171
+
168
172
#if compiler(>=5.5) && (!hasFeature(Embedded) || os(WASI))
169
173
/// Creates a new `JSClosure` that calls the given Swift function asynchronously.
170
174
///
You can’t perform that action at this time.
0 commit comments