Skip to content
Merged
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
20 changes: 20 additions & 0 deletions swift/ql/test/library-tests/dataflow/flowsources/webview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ protocol Exported : JSExport {
var tainted: Any { get }
func tainted(arg1: Any, arg2: Any)
}

class ExportedImpl : Exported {
var tainted: Any { get { return "" } }

Expand Down Expand Up @@ -80,3 +81,22 @@ extension Extended : WKNavigationDelegate {
func webView(_: WKWebView, decidePolicyFor: WKNavigationAction, preferences: WKWebpagePreferences, decisionHandler: (WKNavigationActionPolicy, WKWebpagePreferences) -> Void) {} // $ source=remote
func webView(_: WKWebView, decidePolicyFor: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void) {} // $ source=remote
}

// ---

typealias JSExportAlias = JSExport

protocol Exported2 : JSExportAlias {
var tainted: Any { get }
}
typealias Exported2Alias = Exported2

class ExportedImpl2 : Exported2Alias {
var tainted: Any { get { return "" } }
var notTainted: Any { get { return ""} }

func readFields() {
tainted // $ source=remote
notTainted
}
}