Skip to content

Commit

Permalink
Remove unnecessary _JSObjectProtocol
Browse files Browse the repository at this point in the history
The workaround is no longer needed for the latest toolchain.
  • Loading branch information
kateinoigakukun committed Oct 15, 2024
1 parent b7a3ac6 commit 43607e5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Sources/JavaScriptKit/FundamentalObjects/JSObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import _CJavaScriptKit
/// The lifetime of this object is managed by the JavaScript and Swift runtime bridge library with
/// reference counting system.
@dynamicMemberLookup
public class JSObject: _JSObjectProtocol, Equatable {
public class JSObject: Equatable {
@_spi(JSObject_id)
public var id: JavaScriptObjectRef
@_spi(JSObject_id)
Expand Down Expand Up @@ -231,15 +231,10 @@ public class JSThrowingObject {
}
#endif

/// Internal protocol to support generic arguments for `JSObject`.
///
/// In Swift Embedded, non-final classes cannot have generic methods.
public protocol _JSObjectProtocol: JSObject {
}

#if hasFeature(Embedded)
// NOTE: once embedded supports variadic generics, we can remove these overloads
public extension _JSObjectProtocol {
public extension JSObject {
@_disfavoredOverload
subscript(dynamicMember name: String) -> (() -> JSValue)? {
self[name].function.map { function in
Expand All @@ -261,4 +256,4 @@ public extension _JSObjectProtocol {
}
}
}
#endif
#endif

0 comments on commit 43607e5

Please sign in to comment.