Skip to content

Commit 7e7fe97

Browse files
kateinoigakukunAmzd
andcommitted
Make JSValue's subscript setter nonmutating
Close #132 Co-authored-by: Casper Zandbergen <info@casperzandbergen.nl>
1 parent 6105c33 commit 7e7fe97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/JavaScriptKit/JSValue.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ extension JSValue {
120120
/// - Precondition: `self` must be a JavaScript Object.
121121
public subscript(dynamicMember name: String) -> JSValue {
122122
get { self.object![name] }
123-
set { self.object![name] = newValue }
123+
nonmutating set { self.object![name] = newValue }
124124
}
125125

126126
/// An unsafe convenience method of `JSObject.subscript(_ index: Int) -> JSValue`
127127
/// - Precondition: `self` must be a JavaScript Object.
128128
public subscript(_ index: Int) -> JSValue {
129129
get { object![index] }
130-
set { object![index] = newValue }
130+
nonmutating set { object![index] = newValue }
131131
}
132132
}
133133

0 commit comments

Comments
 (0)