mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
JavaScript: Add basic modelling of React Native WebViews.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Provides classes for working with [React Native](https://facebook.github.io/react-native) code.
|
||||
*/
|
||||
|
||||
import javascript
|
||||
|
||||
module ReactNative {
|
||||
/** A `WebView` JSX element. */
|
||||
class WebViewElement extends DataFlow::ValueNode, DataFlow::DefaultSourceNode {
|
||||
override JSXElement astNode;
|
||||
|
||||
WebViewElement() {
|
||||
DataFlow::moduleMember("react-native", "WebView").flowsToExpr(astNode.getNameExpr())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
| webview.js:6:12:6:56 | <WebVie ... om'}}/> |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from ReactNative::WebViewElement wv
|
||||
select wv
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Component } from 'react';
|
||||
import { WebView } from 'react-native';
|
||||
|
||||
class LgtmView extends Component {
|
||||
render() {
|
||||
return <WebView source={{uri: 'https://lgtm.com'}}/>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user