Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8cdc2d1

Browse filesBrowse files
authored
Make JSValue ExpressibleByNilLiteral (swiftwasm#59)
1 parent 6652885 commit 8cdc2d1
Copy full SHA for 8cdc2d1

1 file changed

+6Lines changed: 6 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Sources/JavaScriptKit/JSValue.swift‎

Copy file name to clipboardExpand all lines: Sources/JavaScriptKit/JSValue.swift
+6Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.