Skip to content

Commit

Permalink
Make JSValue ExpressibleByNilLiteral (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 authored Sep 16, 2020
1 parent 6652885 commit 8cdc2d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/JavaScriptKit/JSValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ extension JSValue: ExpressibleByIntegerLiteral {
}
}

extension JSValue: ExpressibleByNilLiteral {
public init(nilLiteral: ()) {
self = .null
}
}

public func getJSValue(this: JSObject, name: String) -> JSValue {
var rawValue = RawJSValue()
_get_prop(this.id, name, Int32(name.count),
Expand Down

0 comments on commit 8cdc2d1

Please sign in to comment.