Skip to content

Commit 2bd91ed

Browse files
committed
wip
1 parent 0906080 commit 2bd91ed

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/JavaScriptKit/JSObject.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ public class JSObjectRef: Equatable {
77
self.id = id
88
}
99

10+
@_disfavoredOverload
11+
public subscript(_ name: String) -> ((JSValueEncodable...) -> JSValue)? {
12+
guard let function = self[name].function else { return nil }
13+
return { (arguments: JSValueEncodable...) in
14+
function(this: self, args: arguments)
15+
}
16+
}
17+
1018
@_disfavoredOverload
1119
public subscript(dynamicMember name: String) -> ((JSValueEncodable...) -> JSValue)? {
1220
guard let function = self[name].function else { return nil }

0 commit comments

Comments
 (0)