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

Fix #8284: Fix release compilation #8281

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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