Skip to content

Commit 8cdc2d1

Browse files
authored
Make JSValue ExpressibleByNilLiteral (#59)
1 parent 6652885 commit 8cdc2d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/JavaScriptKit/JSValue.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ extension JSValue: ExpressibleByIntegerLiteral {
109109
}
110110
}
111111

112+
extension JSValue: ExpressibleByNilLiteral {
113+
public init(nilLiteral: ()) {
114+
self = .null
115+
}
116+
}
117+
112118
public func getJSValue(this: JSObject, name: String) -> JSValue {
113119
var rawValue = RawJSValue()
114120
_get_prop(this.id, name, Int32(name.count),

0 commit comments

Comments
 (0)