зеркало из https://github.com/github/codeql.git
JavaScript: Add basic modelling of React Native `WebView`s.
This commit is contained in:
Родитель
355302eac4
Коммит
3ce82aff02
|
@ -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'}}/>;
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче