Skip to content

Commit

Permalink
disable convenience func in embedded
Browse files Browse the repository at this point in the history
  • Loading branch information
Amzd committed Nov 17, 2024
1 parent d8a01fd commit c50dcd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/JavaScriptKit/JSValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,15 @@ public extension JSValue {
nonmutating set { self.object![name] = newValue }
}

#if !hasFeature(Embedded)
/// An unsafe convenience method of `JSObject.subscript(_ index: String) -> JSValue`
/// - Precondition: `self` must be a JavaScript Object.
@_disfavoredOverload
subscript(dynamicMember name: String) -> ConvertibleToJSValue {
get { self.object![name] }
nonmutating set { self.object![name] = newValue.jsValue }
}
#endif

/// An unsafe convenience method of `JSObject.subscript(_ index: Int) -> JSValue`
/// - Precondition: `self` must be a JavaScript Object.
Expand Down

0 comments on commit c50dcd1

Please sign in to comment.