Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #8284: Fix release compilation (#8281)
Browse files Browse the repository at this point in the history
Fix release compilation
  • Loading branch information
cuba committed Oct 18, 2023
1 parent 2cc24b1 commit 2a2716a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 28 deletions.
19 changes: 19 additions & 0 deletions Sources/Brave/Frontend/Browser/User Scripts/UserScriptType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,22 @@ enum UserScriptType: Hashable {
}
}
}

extension UserScriptType: CustomDebugStringConvertible {
var debugDescription: String {
switch self {
case .domainUserScript(let domainUserScript):
return "domainUserScript(\(domainUserScript.associatedDomains.joined(separator: ", ")))"
case .engineScript(let configuration):
return "engineScript(\(configuration.frameURL))"
case .farblingProtection(let etld):
return "farblingProtection(\(etld))"
case .nacl:
return "nacl"
case .siteStateListener:
return "siteStateListener"
case .selectorsPoller:
return "selectorsPoller"
}
}
}
29 changes: 1 addition & 28 deletions Sources/Brave/Frontend/Browser/UserScriptManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class UserScriptManager {

let logComponents = [
userScripts.sorted(by: { $0.rawValue < $1.rawValue}).map { scriptType in
" \(scriptType.debugDescription)"
" \(scriptType.rawValue)"
}.joined(separator: "\n"),
customScripts.sorted(by: { $0.order < $1.order}).map { scriptType in
" #\(scriptType.order) \(scriptType.debugDescription)"
Expand Down Expand Up @@ -345,30 +345,3 @@ class UserScriptManager {
}
}
}

#if DEBUG
extension UserScriptType: CustomDebugStringConvertible {
var debugDescription: String {
switch self {
case .domainUserScript(let domainUserScript):
return "domainUserScript(\(domainUserScript.associatedDomains.joined(separator: ", ")))"
case .engineScript(let configuration):
return "engineScript(\(configuration.frameURL))"
case .farblingProtection(let etld):
return "farblingProtection(\(etld))"
case .nacl:
return "nacl"
case .siteStateListener:
return "siteStateListener"
case .selectorsPoller:
return "selectorsPoller"
}
}
}

extension UserScriptManager.ScriptType: CustomDebugStringConvertible {
var debugDescription: String {
return rawValue
}
}
#endif

0 comments on commit 2a2716a

Please sign in to comment.