Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Sources/JavaScriptKit/BasicObjects/JSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ extension JSError: CustomStringConvertible {
/// The textual representation of this error.
public var description: String { jsObject.description }
}

extension JSError: JSValueConstructible {
public static func construct(from value: JSValue) -> JSError? {
guard let object = value.object else { return nil }
return JSError(unsafelyWrapping: object)
}
}